Merge branch 'languages' into follow-route
This commit is contained in:
@@ -28,8 +28,9 @@ import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
public class MainActivity extends AppCompatActivity implements Refreshable{
|
||||
private static final String TAG = MainActivity.class.getName();
|
||||
private BottomNavigationView bottomNav;
|
||||
|
||||
/**
|
||||
* onCreate method that creates the main activity
|
||||
@@ -38,12 +39,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// initialize saved language from sharedPreferences
|
||||
setLocale(loadLocale());
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
BottomNavigationView bottomNav = findViewById(R.id.navigation_bar);
|
||||
bottomNav = findViewById(R.id.navigation_bar);
|
||||
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
||||
|
||||
|
||||
/*System.out.println(Arrays.toString(getFilesDir().listFiles()));
|
||||
FileIO<Route> fileIO = new FileIO<>();
|
||||
fileIO.writeFileData(new Route("TERSTSET"), getApplicationContext());
|
||||
@@ -56,10 +59,9 @@ public class MainActivity extends AppCompatActivity {
|
||||
RouteListManager.INSTANCE.setContext(this);
|
||||
RouteListManager.INSTANCE.load();
|
||||
|
||||
// initialize saved language from sharedPreferences
|
||||
setLocale(loadLocale());
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||
if (savedInstanceState == null) {
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,4 +107,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit();
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* refreshes bottom navigation
|
||||
*/
|
||||
@Override
|
||||
public void refresh() {
|
||||
bottomNav.getMenu().clear();
|
||||
bottomNav.inflateMenu(R.menu.navmenu);
|
||||
bottomNav.setSelectedItemId(R.id.settings);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user