-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
20 changed files
with
758 additions
and
244 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,11 @@ import android.content.Intent | |
import android.net.Uri | ||
import android.os.Bundle | ||
import android.widget.Button | ||
import androidx.appcompat.app.AppCompatActivity | ||
import de.msdevs.einschlafhilfe.databinding.ActivityAboutBinding | ||
import net.cachapa.expandablelayout.ExpandableLayout | ||
|
||
|
||
class AboutActivity : AppCompatActivity() { | ||
class AboutActivity : BaseActivity() { | ||
|
||
private lateinit var binding : ActivityAboutBinding | ||
private lateinit var btnPrivacy : Button | ||
|
@@ -75,7 +74,7 @@ class AboutActivity : AppCompatActivity() { | |
btnAppIntro.setOnClickListener{ | ||
opennUrl("https://github.com/AppIntro/AppIntro") | ||
} | ||
btnGlide.setOnClickListener { | ||
btnContact.setOnClickListener { | ||
val intent = Intent(Intent.ACTION_SENDTO) | ||
intent.setData(Uri.parse("mailto:")) | ||
intent.putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
|
39 changes: 39 additions & 0 deletions
39
app/src/main/java/de/msdevs/einschlafhilfe/BaseActivity.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,39 @@ | ||
package de.msdevs.einschlafhilfe | ||
|
||
|
||
import android.os.Bundle | ||
import android.view.WindowManager | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import de.msdevs.einschlafhilfe.utils.Utility.getTheme | ||
|
||
|
||
open class BaseActivity : AppCompatActivity() { | ||
public override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
updateTheme() | ||
} | ||
|
||
fun updateTheme() { | ||
if (getTheme(applicationContext) <= THEME_RED) { | ||
setTheme(R.style.AppTheme) | ||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | ||
window.statusBarColor = resources.getColor(R.color.colorPrimary) | ||
} else if (getTheme(applicationContext) == THEME_BLUE) { | ||
setTheme(R.style.AppThemeBlue) | ||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | ||
window.statusBarColor = resources.getColor(R.color.colorPrimaryBlue) | ||
} else if (getTheme(applicationContext) == THEME_WHITE) { | ||
setTheme(R.style.AppThemeWhite) | ||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | ||
window.statusBarColor = resources.getColor(R.color.white) | ||
|
||
} | ||
} | ||
|
||
companion object { | ||
private const val THEME_WHITE = 4 | ||
private const val THEME_RED = 2 | ||
private const val THEME_BLUE = 3 | ||
} | ||
} |
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
Oops, something went wrong.