Skip to content

Commit e2976a7

Browse files
committed
initial commit
1 parent a4a6e3a commit e2976a7

File tree

73 files changed

+3043
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3043
-0
lines changed

Diff for: .idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/kotlinc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Diff for: app/build.gradle

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
namespace 'com.boltuix.androidpreferences'
8+
compileSdk 33
9+
10+
defaultConfig {
11+
applicationId "com.boltuix.androidpreferences"
12+
minSdk 24
13+
targetSdk 33
14+
versionCode 1
15+
versionName "1.0"
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
30+
kotlinOptions {
31+
jvmTarget = '1.8'
32+
}
33+
buildFeatures {
34+
viewBinding true
35+
}
36+
buildToolsVersion '33.0.0'
37+
}
38+
39+
dependencies {
40+
41+
implementation 'androidx.core:core-ktx:1.9.0'
42+
implementation 'androidx.appcompat:appcompat:1.5.1'
43+
implementation 'com.google.android.material:material:1.6.1'
44+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
45+
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
46+
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
47+
testImplementation 'junit:junit:4.13.2'
48+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
49+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
50+
}

Diff for: app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.boltuix.androidpreferences
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.boltuix.androidpreferences", appContext.packageName)
23+
}
24+
}

Diff for: app/src/main/AndroidManifest.xml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.AndroidPreferences"
14+
tools:targetApi="31">
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true"
18+
android:label="@string/app_name"
19+
android:theme="@style/Theme.AndroidPreferences">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
26+
<meta-data
27+
android:name="android.app.lib_name"
28+
android:value="" />
29+
</activity>
30+
</application>
31+
32+
</manifest>

Diff for: app/src/main/font/jost_book.ttf

88.7 KB
Binary file not shown.

Diff for: app/src/main/font/jost_medium.ttf

99.8 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.boltuix.androidpreferences
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.boltuix.androidpreferences.databinding.Fragment1Binding
9+
10+
class Fragment1 : Fragment() {
11+
private var _binding: Fragment1Binding? = null
12+
13+
// This property is only valid between onCreateView and
14+
// onDestroyView.
15+
private val binding get() = _binding!!
16+
17+
18+
override fun onCreateView(
19+
inflater: LayoutInflater,
20+
container: ViewGroup?,
21+
savedInstanceState: Bundle?
22+
): View {
23+
_binding = Fragment1Binding.inflate(inflater, container, false)
24+
return binding.root
25+
}
26+
27+
companion object {
28+
fun create(): Fragment1 {
29+
return Fragment1()
30+
}
31+
}
32+
33+
override fun onDestroyView() {
34+
super.onDestroyView()
35+
_binding = null
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.boltuix.androidpreferences
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.boltuix.androidpreferences.databinding.Fragment1Binding
9+
import com.boltuix.androidpreferences.databinding.Fragment2Binding
10+
11+
class Fragment2 : Fragment() {
12+
private var _binding: Fragment2Binding? = null
13+
14+
// This property is only valid between onCreateView and
15+
// onDestroyView.
16+
private val binding get() = _binding!!
17+
18+
19+
override fun onCreateView(
20+
inflater: LayoutInflater,
21+
container: ViewGroup?,
22+
savedInstanceState: Bundle?
23+
): View {
24+
_binding = Fragment2Binding.inflate(inflater, container, false)
25+
return binding.root
26+
}
27+
28+
companion object {
29+
fun create(): Fragment2 {
30+
return Fragment2()
31+
}
32+
}
33+
34+
override fun onDestroyView() {
35+
super.onDestroyView()
36+
_binding = null
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.boltuix.androidpreferences
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.boltuix.androidpreferences.databinding.Fragment1Binding
9+
import com.boltuix.androidpreferences.databinding.Fragment2Binding
10+
11+
class Fragment3 : Fragment() {
12+
private var _binding: Fragment2Binding? = null
13+
14+
// This property is only valid between onCreateView and
15+
// onDestroyView.
16+
private val binding get() = _binding!!
17+
18+
19+
override fun onCreateView(
20+
inflater: LayoutInflater,
21+
container: ViewGroup?,
22+
savedInstanceState: Bundle?
23+
): View {
24+
_binding = Fragment2Binding.inflate(inflater, container, false)
25+
return binding.root
26+
}
27+
28+
companion object {
29+
fun create(): Fragment3 {
30+
return Fragment3()
31+
}
32+
}
33+
34+
override fun onDestroyView() {
35+
super.onDestroyView()
36+
_binding = null
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.boltuix.androidpreferences
2+
3+
import android.os.Bundle
4+
import android.view.View
5+
import android.view.WindowManager
6+
import androidx.appcompat.app.AppCompatActivity
7+
import androidx.core.view.WindowCompat
8+
import androidx.navigation.NavController
9+
import androidx.navigation.fragment.NavHostFragment
10+
import androidx.navigation.ui.AppBarConfiguration
11+
import androidx.navigation.ui.navigateUp
12+
import androidx.navigation.ui.setupActionBarWithNavController
13+
import com.boltuix.androidpreferences.databinding.ActivityMainBinding
14+
15+
class MainActivity : AppCompatActivity() {
16+
17+
private lateinit var appBarConfiguration: AppBarConfiguration
18+
private lateinit var navController: NavController
19+
private lateinit var binding: ActivityMainBinding
20+
21+
override fun onCreate(savedInstanceState: Bundle?) {
22+
WindowCompat.setDecorFitsSystemWindows(window, false)
23+
super.onCreate(savedInstanceState)
24+
25+
binding = ActivityMainBinding.inflate(layoutInflater)
26+
setContentView(binding.root)
27+
28+
setSupportActionBar(binding.toolbar)
29+
30+
val navHostFragment = supportFragmentManager.findFragmentById(binding.container.navHostFragmentContainer.id) as NavHostFragment? ?: return
31+
navController = navHostFragment.navController
32+
appBarConfiguration = AppBarConfiguration.Builder(R.id.tabLayoutDemo).build()
33+
setupActionBarWithNavController(navController, appBarConfiguration)
34+
/*navController.addOnDestinationChangedListener { _, destination, _ ->
35+
when (destination.id) {
36+
R.id.tabLayoutDemo-> {
37+
window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
38+
binding.toolbar.visibility = View.GONE
39+
}
40+
}
41+
}*/
42+
}
43+
44+
45+
override fun onSupportNavigateUp(): Boolean {
46+
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
47+
}
48+
49+
}

0 commit comments

Comments
 (0)