-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate android 4 and communicate it with dialogs (#82)
- Loading branch information
Tobias Rohloff
authored and
Ben-Noah Engelhaupt
committed
Jun 16, 2018
1 parent
4655dc5
commit 7b62589
Showing
7 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
app/src/main/java/de/xikolo/controllers/dialogs/Android4DeprecatedDialog.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,36 @@ | ||
package de.xikolo.controllers.dialogs | ||
|
||
import android.app.Dialog | ||
import android.os.Bundle | ||
import android.support.v7.app.AlertDialog | ||
import de.xikolo.R | ||
import de.xikolo.controllers.dialogs.base.BaseDialogFragment | ||
|
||
class Android4DeprecatedDialog : BaseDialogFragment() { | ||
|
||
companion object { | ||
val TAG: String = Android4DeprecatedDialog::class.java.simpleName | ||
} | ||
|
||
var listener: Listener? = null | ||
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
val builder = AlertDialog.Builder(activity!!, R.style.AppTheme_Dialog) | ||
.setTitle( | ||
getString(R.string.dialog_android_4_deprecation_title) | ||
) | ||
.setMessage( | ||
getString(R.string.dialog_android_4_deprecation_message) | ||
) | ||
.setPositiveButton(getString(R.string.ok)) { _, _ -> | ||
listener?.onConfirmed() | ||
} | ||
|
||
return builder.create() | ||
} | ||
|
||
interface Listener { | ||
fun onConfirmed() | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
app/src/main/java/de/xikolo/controllers/dialogs/Android4UnsupportedDialog.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,36 @@ | ||
package de.xikolo.controllers.dialogs | ||
|
||
import android.app.Dialog | ||
import android.os.Bundle | ||
import android.support.v7.app.AlertDialog | ||
import de.xikolo.R | ||
import de.xikolo.controllers.dialogs.base.BaseDialogFragment | ||
|
||
class Android4UnsupportedDialog : BaseDialogFragment() { | ||
|
||
companion object { | ||
val TAG: String = Android4UnsupportedDialog::class.java.simpleName | ||
} | ||
|
||
var listener: Listener? = null | ||
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
val builder = AlertDialog.Builder(activity!!, R.style.AppTheme_Dialog) | ||
.setTitle( | ||
getString(R.string.dialog_android_4_unsupported_title) | ||
) | ||
.setMessage( | ||
getString(R.string.dialog_android_4_unsupported_message) | ||
) | ||
.setNegativeButton(getString(R.string.dialog_android_4_unsupported_no)) { _, _ -> | ||
listener?.onConfirmed() | ||
} | ||
|
||
return builder.create() | ||
} | ||
|
||
interface Listener { | ||
fun onConfirmed() | ||
} | ||
|
||
} |
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
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