Appearance
源码:labs/android/host/app/src/main/java/com/shayn/engineeringreviewlab/androidhost/MainActivity.kt
- 原始路径:
labs/android/host/app/src/main/java/com/shayn/engineeringreviewlab/androidhost/MainActivity.kt - 类型:
kotlin
kotlin
package com.shayn.engineeringreviewlab.androidhost
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.android_activity_lifecycle_basic.LifecycleLogActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.android_activity_lifecycle_compose.ComposeLifecycleActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.android_activity_lifecycle_java_xml.JavaLifecycleActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.reference_types_demo.ReferenceTypesCacheDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.memory_leak_demo.MemoryLeakDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.modularization_spi.SpiArchitectureDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing.reference_mvi.ReferenceMviActivity
import com.shayn.engineeringreviewlab.androidhost.topics.background_tasks.workmanager_foregroundservice_demo.BackgroundTasksDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.background_tasks.alarmmanager_demo.AlarmManagerDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.background_tasks.recording_upload_handoff.RecordingUploadHandoffActivity
import com.shayn.engineeringreviewlab.androidhost.topics.backend_data.atomic_resource_promotion.AtomicResourcePromotionActivity
import com.shayn.engineeringreviewlab.androidhost.topics.runtime_concurrency.looper_handler_demo.LooperHandlerDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.memory_lifecycle.viewmodel_savedstate_demo.ViewModelSavedStateDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.state_persistence_demo.StatePersistenceDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.one_shot_event_demo.OneShotEventDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.deeplink_navigation_demo.DeepLinkHomeActivity
import com.shayn.engineeringreviewlab.androidhost.topics.performance_testing_debug.jank_monitoring_demo.JankMonitoringDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.runtime_concurrency.binder_messenger_demo.BinderMessengerDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.runtime_concurrency.anr_demo.AnrMechanismDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.performance_testing_debug.startup_timing_demo.StartupTimingDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.bridge_hybrid.h5_sso_demo.H5SsoCookieDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.bridge_hybrid.webview_jsbridge_demo.WebViewJsBridgeActivity
import com.shayn.engineeringreviewlab.androidhost.topics.foundations.aes_gcm_and_frida_detect.AesGcmAndFridaDetectActivity
import com.shayn.engineeringreviewlab.androidhost.topics.specialized_topics.ble_gatt_playground.BleGattPlaygroundActivity
import com.shayn.engineeringreviewlab.androidhost.topics.image_loading.ImageLoadingDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.performance_testing_debug.bitmap_memory_demo.BitmapMemoryDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.performance_testing_debug.native_crash_breakpad.NativeCrashBreakpadActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.android_nested_scroll_coordination_demo.AndroidNestedScrollCoordinationActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.android_expandable_text_demo.AndroidExpandableTextDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.state_routing_architecture.page_result_demo.PageResultDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.screen_adaptation.window_size_class_demo.WindowSizeClassDemoActivity
import com.shayn.engineeringreviewlab.androidhost.topics.screen_adaptation.view_xml_adaptive_demo.ViewXmlAdaptiveDemoActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
findViewById<Button>(R.id.openLifecycleLabButton).setOnClickListener {
startActivity(Intent(this, LifecycleLogActivity::class.java))
}
findViewById<Button>(R.id.openComposeLifecycleLabButton).setOnClickListener {
startActivity(Intent(this, ComposeLifecycleActivity::class.java))
}
findViewById<Button>(R.id.openJavaLifecycleLabButton).setOnClickListener {
startActivity(Intent(this, JavaLifecycleActivity::class.java))
}
findViewById<Button>(R.id.openMviLabButton).setOnClickListener {
startActivity(Intent(this, ReferenceMviActivity::class.java))
}
findViewById<Button>(R.id.openSpiLabButton).setOnClickListener {
startActivity(Intent(this, SpiArchitectureDemoActivity::class.java))
}
findViewById<Button>(R.id.openReferenceTypesLabButton).setOnClickListener {
startActivity(Intent(this, ReferenceTypesCacheDemoActivity::class.java))
}
findViewById<Button>(R.id.openMemoryLeakLabButton).setOnClickListener {
startActivity(Intent(this, MemoryLeakDemoActivity::class.java))
}
findViewById<Button>(R.id.openBackgroundTasksLabButton).setOnClickListener {
startActivity(Intent(this, BackgroundTasksDemoActivity::class.java))
}
findViewById<Button>(R.id.openJsBridgeLabButton).setOnClickListener {
startActivity(Intent(this, WebViewJsBridgeActivity::class.java))
}
findViewById<Button>(R.id.openAlarmLabButton).setOnClickListener {
startActivity(Intent(this, AlarmManagerDemoActivity::class.java))
}
findViewById<Button>(R.id.openRecordingHandoffLabButton).setOnClickListener {
startActivity(Intent(this, RecordingUploadHandoffActivity::class.java))
}
findViewById<Button>(R.id.openAtomicPromotionLabButton).setOnClickListener {
startActivity(Intent(this, AtomicResourcePromotionActivity::class.java))
}
findViewById<Button>(R.id.openLooperLabButton).setOnClickListener {
startActivity(Intent(this, LooperHandlerDemoActivity::class.java))
}
findViewById<Button>(R.id.openViewModelLabButton).setOnClickListener {
startActivity(Intent(this, ViewModelSavedStateDemoActivity::class.java))
}
findViewById<Button>(R.id.openStatePersistenceLabButton).setOnClickListener {
startActivity(Intent(this, StatePersistenceDemoActivity::class.java))
}
findViewById<Button>(R.id.openOneShotLabButton).setOnClickListener {
startActivity(Intent(this, OneShotEventDemoActivity::class.java))
}
findViewById<Button>(R.id.openDeepLinkLabButton).setOnClickListener {
startActivity(Intent(this, DeepLinkHomeActivity::class.java))
}
findViewById<Button>(R.id.openJankLabButton).setOnClickListener {
startActivity(Intent(this, JankMonitoringDemoActivity::class.java))
}
findViewById<Button>(R.id.openBinderLabButton).setOnClickListener {
startActivity(Intent(this, BinderMessengerDemoActivity::class.java))
}
findViewById<Button>(R.id.openAnrLabButton).setOnClickListener {
startActivity(Intent(this, AnrMechanismDemoActivity::class.java))
}
findViewById<Button>(R.id.openStartupLabButton).setOnClickListener {
startActivity(Intent(this, StartupTimingDemoActivity::class.java))
}
findViewById<Button>(R.id.openSsoLabButton).setOnClickListener {
startActivity(Intent(this, H5SsoCookieDemoActivity::class.java))
}
findViewById<Button>(R.id.openAesGcmFridaLabButton).setOnClickListener {
startActivity(Intent(this, AesGcmAndFridaDetectActivity::class.java))
}
findViewById<Button>(R.id.openBleGattLabButton).setOnClickListener {
startActivity(Intent(this, BleGattPlaygroundActivity::class.java))
}
findViewById<Button>(R.id.openNativeCrashLabButton).setOnClickListener {
startActivity(Intent(this, NativeCrashBreakpadActivity::class.java))
}
findViewById<Button>(R.id.openImageLoadingLabButton).setOnClickListener {
startActivity(Intent(this, ImageLoadingDemoActivity::class.java))
}
findViewById<Button>(R.id.openBitmapMemoryLabButton).setOnClickListener {
startActivity(Intent(this, BitmapMemoryDemoActivity::class.java))
}
findViewById<Button>(R.id.openNestedScrollCoordinationLabButton).setOnClickListener {
startActivity(Intent(this, AndroidNestedScrollCoordinationActivity::class.java))
}
findViewById<Button>(R.id.openExpandableTextLabButton).setOnClickListener {
startActivity(Intent(this, AndroidExpandableTextDemoActivity::class.java))
}
findViewById<Button>(R.id.openPageResultLabButton).setOnClickListener {
startActivity(Intent(this, PageResultDemoActivity::class.java))
}
findViewById<Button>(R.id.openWindowSizeClassLabButton).setOnClickListener {
startActivity(Intent(this, WindowSizeClassDemoActivity::class.java))
}
findViewById<Button>(R.id.openViewXmlAdaptiveLabButton).setOnClickListener {
startActivity(Intent(this, ViewXmlAdaptiveDemoActivity::class.java))
}
}
}