Skip to content

Commit

Permalink
small changes (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 authored Dec 28, 2023
1 parent 7684a15 commit bbc9867
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.AlphaAnimation
import android.view.animation.LayoutAnimationController
import android.view.animation.OvershootInterpolator
import android.widget.AbsListView
import android.widget.AutoCompleteTextView
Expand Down Expand Up @@ -145,15 +147,23 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
gridView.visibility = View.GONE
gridView = view.findViewById(R.id.gridView1)
gridView.adapter = adapter
gridView.scheduleLayoutAnimation()
gridView.visibility = View.VISIBLE
adapter.notifyNewGrid()
}

gridView = if(style == 0) view.findViewById(R.id.gridView) else view.findViewById(R.id.gridView1)
gridView.visibility = View.VISIBLE
getDownloads()

val fadeIn = AlphaAnimation(0f, 1f)
fadeIn.duration = 200 // animations pog
val animation = LayoutAnimationController(fadeIn)

gridView.layoutAnimation = animation
adapter = OfflineMangaAdapter(requireContext(), downloads, this)
gridView.adapter = adapter
gridView.scheduleLayoutAnimation()
gridView.setOnItemClickListener { parent, view, position, id ->
// Get the OfflineMangaModel that was clicked
val item = adapter.getItem(position) as OfflineMangaModel
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
}
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}

binding.animeTitleContainer.updatePadding(top = statusBarHeight)

Expand Down
8 changes: 0 additions & 8 deletions app/src/main/java/ani/dantotsu/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ class HomeFragment : Fragment() {
snackString(currContext()?.getString(R.string.please_reload))
}
}
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}
binding.homeUserAvatarContainer.setSafeOnClickListener {
val dialogFragment =
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.HOME)
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold

val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}

binding.mangaTitleContainer.updatePadding(top = statusBarHeight)

Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/ani/dantotsu/media/user/ListActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ListActivity : AppCompatActivity() {
binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor)
binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor)
val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings()
if (!uiSettings.immersiveModeList) {
if (!uiSettings.immersiveMode) {
this.window.statusBarColor =
ContextCompat.getColor(this, R.color.nav_bg_inv)
binding.root.fitsSystemWindows = true
Expand All @@ -78,8 +78,7 @@ class ListActivity : AppCompatActivity() {
setContentView(binding.root)

val anime = intent.getBooleanExtra("anime", true)
binding.listTitle.text =
intent.getStringExtra("username") + "'s " + (if (anime) "Anime" else "Manga") + " List"
binding.listTitle.text = (if (anime) "Anime" else "Manga") + " List"

binding.listTabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ data class UserInterfaceSettings(

//App
var immersiveMode: Boolean = false,
var immersiveModeList: Boolean = false,
var smallView: Boolean = true,
var defaultStartUpTab: Int = 1,
var homeLayoutShow: MutableList<Boolean> = mutableListOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
saveData(ui, settings)
restartApp()
}
binding.uiSettingsImmersiveList.isChecked = settings.immersiveModeList
binding.uiSettingsImmersiveList.setOnCheckedChangeListener { _, isChecked ->
settings.immersiveModeList = isChecked
saveData(ui, settings)
restartApp()
}

binding.uiSettingsBannerAnimation.isChecked = settings.bannerAnimations
binding.uiSettingsBannerAnimation.setOnCheckedChangeListener { _, isChecked ->
settings.bannerAnimations = isChecked
Expand Down
17 changes: 0 additions & 17 deletions app/src/main/res/layout/activity_extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,6 @@
app:tabPaddingStart="16dp"
app:tabTextAppearance="@style/NavBarText"
app:tabGravity="fill">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/installed_anime"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/available_anime"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/installed_manga"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Available Manga"
tools:ignore="HardcodedText" />
</com.google.android.material.tabs.TabLayout>

<com.google.android.material.textfield.TextInputLayout
Expand Down
22 changes: 0 additions & 22 deletions app/src/main/res/layout/activity_user_interface_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,6 @@

</com.google.android.material.materialswitch.MaterialSwitch>

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/uiSettingsImmersiveList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="true"
android:drawableStart="@drawable/ic_round_fullscreen_24"
android:drawablePadding="16dp"
app:drawableTint="?attr/colorPrimary"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/immersive_modelist"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:showText="false"
app:thumbTint="@color/button_switch_track">

</com.google.android.material.materialswitch.MaterialSwitch>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
Expand Down

0 comments on commit bbc9867

Please sign in to comment.