Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/ActivityPrincipal.java
Show All 35 Lines | |||||
import androidx.appcompat.app.ActionBarDrawerToggle; | import androidx.appcompat.app.ActionBarDrawerToggle; | ||||
import androidx.appcompat.widget.Toolbar; | import androidx.appcompat.widget.Toolbar; | ||||
import androidx.core.view.GravityCompat; | import androidx.core.view.GravityCompat; | ||||
import androidx.drawerlayout.widget.DrawerLayout; | import androidx.drawerlayout.widget.DrawerLayout; | ||||
import androidx.fragment.app.Fragment; | import androidx.fragment.app.Fragment; | ||||
import androidx.fragment.app.FragmentManager; | import androidx.fragment.app.FragmentManager; | ||||
import androidx.fragment.app.FragmentTransaction; | import androidx.fragment.app.FragmentTransaction; | ||||
import androidx.preference.PreferenceManager; | import androidx.preference.PreferenceManager; | ||||
import androidx.work.BackoffPolicy; | |||||
import androidx.work.Constraints; | |||||
import androidx.work.ExistingPeriodicWorkPolicy; | |||||
import androidx.work.NetworkType; | |||||
import androidx.work.PeriodicWorkRequest; | |||||
import androidx.work.WorkInfo; | import androidx.work.WorkInfo; | ||||
import androidx.work.WorkManager; | import androidx.work.WorkManager; | ||||
import com.google.android.material.navigation.NavigationView; | import com.google.android.material.navigation.NavigationView; | ||||
import com.google.android.material.snackbar.Snackbar; | import com.google.android.material.snackbar.Snackbar; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.concurrent.TimeUnit; | |||||
import it.reyboz.bustorino.backend.Stop; | import it.reyboz.bustorino.backend.Stop; | ||||
import it.reyboz.bustorino.data.DBUpdateWorker; | import it.reyboz.bustorino.data.DBUpdateWorker; | ||||
import it.reyboz.bustorino.data.DatabaseUpdate; | import it.reyboz.bustorino.data.DatabaseUpdate; | ||||
import it.reyboz.bustorino.fragments.*; | import it.reyboz.bustorino.fragments.*; | ||||
import it.reyboz.bustorino.middleware.GeneralActivity; | import it.reyboz.bustorino.middleware.GeneralActivity; | ||||
import static it.reyboz.bustorino.backend.utils.getBusStopIDFromUri; | import static it.reyboz.bustorino.backend.utils.getBusStopIDFromUri; | ||||
▲ Show 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | private void createDefaultSnackbar() { | ||||
View baseView = null; | View baseView = null; | ||||
final Fragment frag = getSupportFragmentManager().findFragmentById(R.id.mainActContentFrame); | final Fragment frag = getSupportFragmentManager().findFragmentById(R.id.mainActContentFrame); | ||||
if (frag instanceof ScreenBaseFragment){ | if (frag instanceof ScreenBaseFragment){ | ||||
baseView = ((ScreenBaseFragment) frag).getBaseViewForSnackBar(); | baseView = ((ScreenBaseFragment) frag).getBaseViewForSnackBar(); | ||||
} | } | ||||
if (baseView == null) baseView = findViewById(R.id.mainActContentFrame); | if (baseView == null) baseView = findViewById(R.id.mainActContentFrame); | ||||
if (baseView == null) Log.e(DEBUG_TAG, "baseView null for default snackbar, probably exploding now"); | if (baseView == null) Log.e(DEBUG_TAG, "baseView null for default snackbar, probably exploding now"); | ||||
snackbar = Snackbar.make(baseView, R.string.database_update_message, Snackbar.LENGTH_INDEFINITE); | snackbar = Snackbar.make(baseView, R.string.database_update_msg_inapp, Snackbar.LENGTH_INDEFINITE); | ||||
snackbar.show(); | snackbar.show(); | ||||
} | } | ||||
private MainScreenFragment createAndShowMainFragment(){ | private MainScreenFragment createAndShowMainFragment(){ | ||||
FragmentManager fraMan = getSupportFragmentManager(); | FragmentManager fraMan = getSupportFragmentManager(); | ||||
MainScreenFragment fragment = MainScreenFragment.newInstance(); | MainScreenFragment fragment = MainScreenFragment.newInstance(); | ||||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register