-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28c5f2f
commit e0524a4
Showing
154 changed files
with
1,781 additions
and
656 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 14 additions & 7 deletions
21
uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AIChatBotHomeActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
uikit-samples/src/main/java/com/sendbird/uikit/samples/common/ThemeHomeActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.sendbird.uikit.samples.common | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.viewbinding.ViewBinding | ||
import com.sendbird.uikit.samples.R | ||
import com.sendbird.uikit.samples.common.extensions.isUsingDarkTheme | ||
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils | ||
|
||
abstract class ThemeHomeActivity : AppCompatActivity() { | ||
abstract val binding: ViewBinding | ||
val isDarkTheme: Boolean | ||
get() = PreferenceUtils.themeMode.isUsingDarkTheme() | ||
private var currentThemeMode = PreferenceUtils.themeMode | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setTheme(if (PreferenceUtils.themeMode.isUsingDarkTheme()) R.style.AppTheme_Dark else R.style.AppTheme) | ||
setContentView(binding.root) | ||
applyTheme() | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
if (currentThemeMode != PreferenceUtils.themeMode) { | ||
currentThemeMode = PreferenceUtils.themeMode | ||
recreate() | ||
} | ||
} | ||
|
||
open fun applyTheme() { | ||
val backgroundRedId = if (isDarkTheme) R.color.background_600 else R.color.background_50 | ||
binding.apply { | ||
root.setBackgroundResource(backgroundRedId) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
uikit-samples/src/main/res/drawable/selector_home_channel_type_button_dark.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_pressed="true"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/primary_500"/> | ||
<corners android:radius="@dimen/sb_size_8"/> | ||
</shape> | ||
</item> | ||
|
||
<item android:state_pressed="false"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/background_400"/> | ||
<corners android:radius="@dimen/sb_size_8"/> | ||
</shape> | ||
</item> | ||
</selector> |
19 changes: 19 additions & 0 deletions
19
uikit-samples/src/main/res/drawable/selector_home_signout_button_dark.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_pressed="true"> | ||
<shape android:shape="rectangle"> | ||
<corners android:radius="@dimen/sb_size_4"/> | ||
<solid android:color="@color/primary_300"/> | ||
<stroke android:color="@color/primary_400" | ||
android:width="@dimen/sb_size_1"/> | ||
</shape> | ||
</item> | ||
<item android:state_pressed="false"> | ||
<shape android:shape="rectangle"> | ||
<corners android:radius="@dimen/sb_size_4"/> | ||
<stroke android:color="@color/primary_300" | ||
android:width="@dimen/sb_size_1"/> | ||
<solid android:color="@color/primary_200"/> | ||
</shape> | ||
</item> | ||
</selector> |
Oops, something went wrong.