Commit a60f8069 authored by Mohit Mali's avatar Mohit Mali
Browse files

Resolve rotation bug without manifest fix

parent 28a30d80
Pipeline #101180 passed with stage
in 11 minutes and 20 seconds
......@@ -30,8 +30,7 @@
android:theme="@style/AppTheme">
<!-- <activity android:name=".application.PwaInstaller"/>-->
<activity android:name=".settings.AppRequestActivity" />
<activity android:name=".MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -33,17 +33,17 @@ import foundation.e.apps.categories.viewmodel.CategoriesViewModel
import kotlinx.android.synthetic.main.error_layout.view.*
import kotlinx.android.synthetic.main.fragment_application_categories.view.*
class ApplicationsFragment(color: Int?) : Fragment() {
class ApplicationsFragment() : Fragment() {
private lateinit var categoriesViewModel: CategoriesViewModel
val color = color;
var color:Int = 0;
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
categoriesViewModel = ViewModelProviders.of(activity!!).get(CategoriesViewModel::class.java)
val view = inflater.inflate(R.layout.fragment_application_categories, container, false)
view.categories_list.layoutManager = LinearLayoutManager(context)
color = arguments!!.getInt("color",0)
view.categories_list.visibility = View.GONE
view.progress_bar.visibility = View.VISIBLE
view.error_container.visibility = View.GONE
......@@ -85,4 +85,13 @@ class ApplicationsFragment(color: Int?) : Fragment() {
}
return view
}
companion object{
fun newInstance(color:Int?) : ApplicationsFragment{
val applicationsFragment = ApplicationsFragment()
val bundle = Bundle()
bundle.putInt("color",color!!)
applicationsFragment.arguments = bundle
return applicationsFragment
}
}
}
......@@ -24,8 +24,8 @@ import androidx.fragment.app.FragmentStatePagerAdapter
class CategoriesViewPagerAdapter(fragmentManager: FragmentManager, private val numberOfTabs: Int, color: Int?) :
FragmentStatePagerAdapter(fragmentManager) {
private val applicationsFragment = ApplicationsFragment(color)
private val gamesFragment = GamesFragment(color)
private val applicationsFragment = ApplicationsFragment.newInstance(color)
private val gamesFragment = GamesFragment.newInstance(color)
private val pwasFragment = PwasFragment()
......
......@@ -32,17 +32,17 @@ import foundation.e.apps.categories.viewmodel.CategoriesViewModel
import kotlinx.android.synthetic.main.error_layout.view.*
import kotlinx.android.synthetic.main.fragment_games_categories.view.*
class GamesFragment(color: Int?) : Fragment() {
class GamesFragment() : Fragment() {
private lateinit var categoriesViewModel: CategoriesViewModel
var color=color;
var color:Int = 0;
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
categoriesViewModel = ViewModelProviders.of(activity!!).get(CategoriesViewModel::class.java)
val view = inflater.inflate(R.layout.fragment_games_categories, container, false)
view.categories_list.layoutManager = LinearLayoutManager(context)
color = arguments!!.getInt("color",0)
view.categories_list.visibility = View.GONE
view.progress_bar.visibility = View.VISIBLE
view.error_container.visibility = View.GONE
......@@ -81,4 +81,14 @@ class GamesFragment(color: Int?) : Fragment() {
}
return view
}
companion object{
fun newInstance(color:Int?) : GamesFragment{
val gamesFragment = GamesFragment()
val bundle = Bundle()
bundle.putInt("color",color!!)
gamesFragment.arguments = bundle
return gamesFragment
}
}
}
......@@ -50,6 +50,7 @@ class UpdatesFragment() : Fragment() {
private lateinit var recyclerView: RecyclerView
private var applicationList = ArrayList<Application>()
var accentColorOS=0;
lateinit var progressBar2:ProgressBar
fun initialise(applicationManager: ApplicationManager, accentColorOS: Int) {
this.applicationManager = applicationManager
......@@ -65,6 +66,7 @@ class UpdatesFragment() : Fragment() {
updatesViewModel = ViewModelProviders.of(activity!!).get(UpdatesViewModel::class.java)
recyclerView = view.findViewById(R.id.app_list)
progressBar2 = view.findViewById<ProgressBar>(R.id.progress_bar2)
val updateAll = view.findViewById<Button>(R.id.update_all)
updateAll.setTextColor(accentColorOS)
val splashContainer = view.findViewById<LinearLayout>(R.id.splash_container)
......@@ -154,7 +156,6 @@ class UpdatesFragment() : Fragment() {
override fun onResume() {
super.onResume()
val progressBar2 = view!!.findViewById<ProgressBar>(R.id.progress_bar2)
if (::updatesViewModel.isInitialized) {
updatesViewModel.getApplications().value?.let {
it.forEach { application ->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment