Skip to content

Commit

Permalink
Update 5.0_r1
Browse files Browse the repository at this point in the history
  • Loading branch information
D4rK7355608 committed May 2, 2023
1 parent b1c2eb9 commit d80f3a5
Show file tree
Hide file tree
Showing 115 changed files with 2,878 additions and 1,247 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 5.0_r1:
- Added ability to choose from a variety of fonts for your code display.
- Added a new lesson on using Linear Layout.
- Added a new lesson on using Relative Layout.
- Added a new lesson on using Table Layout.
- Added a new lesson on using Grid View.
- Added Android 14 to Android SDK's.
- Added language support for Hungarian.
- Reworked language system, making it more accurate and user-friendly.
- Fixed various bugs and improved readability, consistency, app performance, and responsiveness by optimizing and styling the outdated code.
- Made various under-the-hood improvements for a better overall app experience.

# Version 4.2_r3:
- Made minor under-the-hood improvements for a better overall app experience.

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId 'com.d4rk.androidtutorials'
minSdkVersion 26
targetSdkVersion 33
versionCode 46
versionName '4.2_r3'
versionCode 50
versionName '5.0_r1'
archivesBaseName = "${applicationId}-v${versionName}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
resConfigs 'en', 'de', 'es', 'fr', 'hi', 'in', 'it', 'ja', 'ro', 'ru', 'tr', 'sv', 'bg', 'pl', 'uk'
Expand Down
45 changes: 40 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
<activity
android:name=".ui.startup.StartupActivity"
android:theme="@style/AppTheme"/>
<activity
android:name=".ui.settings.language.LanguageActivity"
android:exported="false"
android:label="@string/language"
android:parentActivityName=".ui.settings.language.LanguageActivity"/>
<activity
android:name=".ui.android.buttons.toggle.ToggleCodeActivity"
android:exported="false"
Expand Down Expand Up @@ -167,6 +162,46 @@
android:exported="false"
android:label="@string/textbox"
android:parentActivityName=".ui.android.textboxes.textbox.TextboxCodeActivity"/>
<activity
android:name=".ui.android.layouts.linear.LinearLayoutActivity"
android:exported="false"
android:label="@string/linear_layout"
android:parentActivityName=".ui.android.layouts.linear.LinearLayoutActivity"/>
<activity
android:name=".ui.android.layouts.linear.LinearLayoutCodeActivity"
android:exported="false"
android:label="@string/linear_layout"
android:parentActivityName=".ui.android.layouts.linear.LinearLayoutCodeActivity"/>
<activity
android:name=".ui.android.layouts.relative.RelativeLayoutActivity"
android:exported="false"
android:label="@string/relative_layout"
android:parentActivityName=".ui.android.layouts.relative.RelativeLayoutActivity"/>
<activity
android:name=".ui.android.layouts.relative.RelativeLayoutCodeActivity"
android:exported="false"
android:label="@string/relative_layout"
android:parentActivityName=".ui.android.layouts.relative.RelativeLayoutCodeActivity"/>
<activity
android:name=".ui.android.layouts.table.TableLayoutActivity"
android:exported="false"
android:label="@string/table_layout"
android:parentActivityName=".ui.android.layouts.table.TableLayoutActivity"/>
<activity
android:name=".ui.android.layouts.table.TableLayoutCodeActivity"
android:exported="false"
android:label="@string/table_layout"
android:parentActivityName=".ui.android.layouts.table.TableLayoutCodeActivity"/>
<activity
android:name=".ui.android.views.grid.GirdViewActivity"
android:exported="false"
android:label="@string/grid_view"
android:parentActivityName=".ui.android.views.grid.GirdViewActivity"/>
<activity
android:name=".ui.android.views.grid.GirdViewCodeActivity"
android:exported="false"
android:label="@string/grid_view"
android:parentActivityName=".ui.android.views.grid.GirdViewCodeActivity"/>
<activity
android:name=".ui.android.alerts.alertdialog.AlertDialogActivity"
android:exported="false"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/kotlin/com/d4rk/androidtutorials/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.NotificationCompat
import androidx.core.os.LocaleListCompat
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration
Expand Down Expand Up @@ -60,6 +61,8 @@ class MainActivity : AppCompatActivity() {
themeValues[3] -> AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
}
val languageCode = sharedPreferences?.getString(getString(R.string.key_language), getString(R.string.default_value_language))
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(languageCode))
AppCompatDelegate.setDefaultNightMode(nightMode)
binding.navView.labelVisibilityMode = when (sharedPreferences.getString(labelKey, labelDefaultValue)) {
bottomNavigationBarLabelsValues[0] -> NavigationBarView.LABEL_VISIBILITY_LABELED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ class AlertDialogTabCodeFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? = ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class AlertDialogTabLayoutFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? =
ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class SnackBarTabCodeFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? =
ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class SnackBarTabLayoutFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? =
ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class ToastTabCodeFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? =
ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class ToastTabLayoutFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? =
ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textView.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textView.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ class ViewBindingTutorialActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(this)
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? = ResourcesCompat.getFont(this, R.font.font_roboto_mono)
binding.bindingText.typeface = monospaceFont
binding.bindingActivitiesText.typeface = monospaceFont
binding.bindingFragmentsText.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(this, R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(this, R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(this, R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(this, R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(this, R.font.font_poppins)
"5" -> ResourcesCompat.getFont(this, R.font.font_roboto_mono)
else -> null
}
binding.bindingText.typeface = monospaceFont
binding.bindingActivitiesText.typeface = monospaceFont
binding.bindingFragmentsText.typeface = monospaceFont
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ class ButtonsTabCodeFragment : Fragment() {
override fun onResume() {
super.onResume()
val preference = PreferenceManager.getDefaultSharedPreferences(requireContext())
val preferenceFont = preference.getBoolean(getString(R.string.key_monospace_font), false)
if (preferenceFont) {
val monospaceFont: Typeface? = ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
binding.textViewCode.typeface = monospaceFont
val monospaceFont: Typeface? = when (preference.getString(getString(R.string.key_monospace_font), "0")) {
"0" -> ResourcesCompat.getFont(requireContext(), R.font.font_audiowide)
"1" -> ResourcesCompat.getFont(requireContext(), R.font.font_fira_code)
"2" -> ResourcesCompat.getFont(requireContext(), R.font.font_jetbrains_mono)
"3" -> ResourcesCompat.getFont(requireContext(), R.font.font_noto_sans_mono)
"4" -> ResourcesCompat.getFont(requireContext(), R.font.font_poppins)
"5" -> ResourcesCompat.getFont(requireContext(), R.font.font_roboto_mono)
else -> null
}
binding.textViewCode.typeface = monospaceFont
}
}
Loading

0 comments on commit d80f3a5

Please sign in to comment.