-
Notifications
You must be signed in to change notification settings - Fork 35
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
1 parent
520bbf1
commit 88e3848
Showing
12 changed files
with
178 additions
and
4 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/fatherofapps/androidbase/activities/MainActivity.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 |
---|---|---|
@@ -1,16 +1,28 @@ | ||
package com.fatherofapps.androidbase.activities | ||
|
||
import android.os.Bundle | ||
import android.util.Log | ||
import android.view.View | ||
import android.widget.FrameLayout | ||
import com.fatherofapps.androidbase.R | ||
import com.fatherofapps.androidbase.base.activities.BaseActivity | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainActivity : BaseActivity(){ | ||
|
||
private var loadingLayout: FrameLayout? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
Log.e("Frank","MainActivity") | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
loadingLayout = findViewById(R.id.loadingLayout) | ||
} | ||
|
||
override fun showLoading(isShow: Boolean) { | ||
loadingLayout?.visibility = if(isShow) View.VISIBLE else View.GONE | ||
} | ||
|
||
|
||
} |
22 changes: 18 additions & 4 deletions
22
app/src/main/java/com/fatherofapps/androidbase/activities/SplashActivity.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 |
---|---|---|
@@ -1,17 +1,31 @@ | ||
package com.fatherofapps.androidbase.activities | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.os.PersistableBundle | ||
import android.util.Log | ||
import android.widget.ImageView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.fatherofapps.androidbase.R | ||
import com.fatherofapps.androidbase.activities.MainActivity | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class SplashActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { | ||
super.onCreate(savedInstanceState, persistentState) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
Log.e("Frank","SplashAcitivty") | ||
super.onCreate(savedInstanceState) | ||
|
||
setContentView(R.layout.activity_splash) | ||
findViewById<ImageView>(R.id.imgLaunch).postDelayed({ | ||
openMainActivity() | ||
}, 3000) | ||
} | ||
|
||
private fun openMainActivity() { | ||
val intent = Intent(this, MainActivity::class.java) | ||
startActivity(intent) | ||
finish() | ||
} | ||
|
||
} |
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
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/fatherofapps/androidbase/ui/home/HomeFragment.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 |
---|---|---|
@@ -1,9 +1,28 @@ | ||
package com.fatherofapps.androidbase.ui.home | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.fatherofapps.androidbase.base.fragment.BaseFragment | ||
import com.fatherofapps.androidbase.databinding.FragmentHomeBinding | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class HomeFragment : BaseFragment() { | ||
|
||
|
||
private lateinit var dataBinding: FragmentHomeBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
dataBinding = FragmentHomeBinding.inflate(inflater) | ||
dataBinding.lifecycleOwner = viewLifecycleOwner | ||
return dataBinding.root | ||
} | ||
|
||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_height="match_parent"> | ||
<androidx.fragment.app.FragmentContainerView | ||
android:id="@+id/container" | ||
android:name="androidx.navigation.fragment.NavHostFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
app:defaultNavHost="true" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:navGraph="@navigation/main_nav" /> | ||
|
||
<FrameLayout | ||
android:id="@+id/loadingLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@android:color/darker_gray" | ||
android:clickable="true" | ||
android:elevation="12dp" | ||
android:focusable="true" | ||
android:visibility="gone"> | ||
|
||
<ProgressBar | ||
style="?android:attr/progressBarStyleLarge" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" /> | ||
</FrameLayout> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
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,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<ImageView | ||
android:id="@+id/imgLaunch" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:src="@drawable/home_spaceship_launch" | ||
android:paddingHorizontal="24dp" | ||
app:layout_constraintDimensionRatio="500:632" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
android:layout_width="0dp" | ||
android:layout_height="0dp"/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
android:text="Home" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<navigation xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/main_nav" | ||
app:startDestination="@id/homeFragment"> | ||
|
||
<fragment | ||
android:id="@+id/homeFragment" | ||
android:name="com.fatherofapps.androidbase.ui.home.HomeFragment" | ||
android:label="HomeFragment" /> | ||
</navigation> |
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,10 @@ | ||
|
||
|
||
## This file must *NOT* be checked into Version Control Systems, | ||
# as it contains information specific to your local configuration. | ||
# | ||
# Location of the SDK. This is only used by Gradle. | ||
# For customization when using a Version Control System, please read the | ||
# header note. | ||
#Tue Mar 22 21:33:40 ICT 2022 | ||
sdk.dir=/Users/nhatvu/Library/Android/sdk |