2015-04-03 21:54:41 +00:00
|
|
|
package org.microg.gms.ui;
|
|
|
|
|
2020-08-03 16:07:06 +00:00
|
|
|
import android.content.Intent;
|
2015-04-03 21:54:41 +00:00
|
|
|
import android.os.Bundle;
|
|
|
|
|
2020-07-08 18:04:23 +00:00
|
|
|
import androidx.annotation.Nullable;
|
2020-07-26 09:59:27 +00:00
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
import androidx.navigation.NavController;
|
|
|
|
import androidx.navigation.fragment.NavHostFragment;
|
|
|
|
import androidx.navigation.ui.AppBarConfiguration;
|
|
|
|
import androidx.navigation.ui.NavigationUI;
|
2020-07-08 18:04:23 +00:00
|
|
|
|
2015-04-03 21:54:41 +00:00
|
|
|
import com.google.android.gms.R;
|
|
|
|
|
2020-07-26 09:59:27 +00:00
|
|
|
public class SettingsActivity extends AppCompatActivity {
|
|
|
|
private AppBarConfiguration appBarConfiguration;
|
2017-02-22 03:20:46 +00:00
|
|
|
|
2020-07-26 09:59:27 +00:00
|
|
|
private NavController getNavController() {
|
|
|
|
return ((NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.navhost)).getNavController();
|
2016-11-15 23:52:49 +00:00
|
|
|
}
|
2016-01-12 22:27:43 +00:00
|
|
|
|
2015-04-03 21:54:41 +00:00
|
|
|
@Override
|
2020-07-26 09:59:27 +00:00
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
2020-08-03 16:07:06 +00:00
|
|
|
|
|
|
|
Intent intent = getIntent();
|
2020-10-07 16:14:41 +00:00
|
|
|
NearbyPreferencesIntegration.Companion.preProcessSettingsIntent(intent);
|
2020-08-03 16:07:06 +00:00
|
|
|
|
2020-07-26 09:59:27 +00:00
|
|
|
setContentView(R.layout.settings_root_activity);
|
2017-02-08 13:13:34 +00:00
|
|
|
|
2020-07-26 09:59:27 +00:00
|
|
|
appBarConfiguration = new AppBarConfiguration.Builder(getNavController().getGraph()).build();
|
|
|
|
NavigationUI.setupActionBarWithNavController(this, getNavController(), appBarConfiguration);
|
|
|
|
}
|
2017-02-22 03:20:46 +00:00
|
|
|
|
2020-07-26 09:59:27 +00:00
|
|
|
@Override
|
|
|
|
public boolean onSupportNavigateUp() {
|
|
|
|
return NavigationUI.navigateUp(getNavController(), appBarConfiguration) || super.onSupportNavigateUp();
|
2015-04-03 21:54:41 +00:00
|
|
|
}
|
|
|
|
}
|