forked from commons-app/apps-android-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated settings modules from Java to Kotlin (commons-app#5944)
* Rename .java to .kt * Migrated settings module to Kotlin
- Loading branch information
1 parent
5f1d284
commit cf88f9b
Showing
6 changed files
with
640 additions
and
665 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package fr.free.nrw.commons.settings | ||
|
||
object Prefs { | ||
const val GLOBAL_PREFS = "fr.free.nrw.commons.preferences" | ||
|
||
const val TRACKING_ENABLED = "eventLogging" | ||
const val DEFAULT_LICENSE = "defaultLicense" | ||
const val UPLOADS_SHOWING = "uploadsShowing" | ||
const val MANAGED_EXIF_TAGS = "managed_exif_tags" | ||
const val DESCRIPTION_LANGUAGE = "languageDescription" | ||
const val APP_UI_LANGUAGE = "appUiLanguage" | ||
const val KEY_THEME_VALUE = "appThemePref" | ||
|
||
object Licenses { | ||
const val CC_BY_SA_3 = "CC BY-SA 3.0" | ||
const val CC_BY_3 = "CC BY 3.0" | ||
const val CC_BY_SA_4 = "CC BY-SA 4.0" | ||
const val CC_BY_4 = "CC BY 4.0" | ||
const val CC0 = "CC0" | ||
} | ||
} |
69 changes: 0 additions & 69 deletions
69
app/src/main/java/fr/free/nrw/commons/settings/SettingsActivity.java
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
app/src/main/java/fr/free/nrw/commons/settings/SettingsActivity.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,63 @@ | ||
package fr.free.nrw.commons.settings | ||
|
||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import fr.free.nrw.commons.databinding.ActivitySettingsBinding | ||
import fr.free.nrw.commons.theme.BaseActivity | ||
|
||
|
||
/** | ||
* allows the user to change the settings | ||
*/ | ||
class SettingsActivity : BaseActivity() { | ||
|
||
private lateinit var binding: ActivitySettingsBinding | ||
// private var settingsDelegate: AppCompatDelegate? = null | ||
|
||
/** | ||
* to be called when the activity starts | ||
* @param savedInstanceState the previously saved state | ||
*/ | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding = ActivitySettingsBinding.inflate(layoutInflater) | ||
val view = binding.root | ||
setContentView(view) | ||
|
||
setSupportActionBar(binding.toolbarBinding.toolbar) | ||
supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
} | ||
|
||
// Get an action bar | ||
/** | ||
* takes care of actions taken after the creation has happened | ||
* @param savedInstanceState the saved state | ||
*/ | ||
override fun onPostCreate(savedInstanceState: Bundle?) { | ||
super.onPostCreate(savedInstanceState) | ||
// if (settingsDelegate == null) { | ||
// settingsDelegate = AppCompatDelegate.create(this, null) | ||
// } | ||
// settingsDelegate?.onPostCreate(savedInstanceState) | ||
} | ||
|
||
override fun onSupportNavigateUp(): Boolean { | ||
onBackPressed() | ||
return true | ||
} | ||
|
||
/** | ||
* Handle action-bar clicks | ||
* @param item the selected item | ||
* @return true on success, false on failure | ||
*/ | ||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
return when (item.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
true | ||
} | ||
else -> super.onOptionsItemSelected(item) | ||
} | ||
} | ||
} |
Oops, something went wrong.