use of com.amaze.filemanager.fragments.DbViewerFragment in project AmazeFileManager by TeamAmaze.
the class DatabaseViewerActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
this.checkStorage = false;
super.onCreate(savedInstanceState);
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
if (getAppTheme().equals(AppTheme.DARK)) {
setTheme(R.style.appCompatDark);
getWindow().getDecorView().setBackgroundColor(Utils.getColor(this, R.color.holo_dark_background));
} else if (getAppTheme().equals(AppTheme.BLACK)) {
setTheme(R.style.appCompatBlack);
getWindow().getDecorView().setBackgroundColor(Utils.getColor(this, android.R.color.black));
}
setContentView(R.layout.activity_db_viewer);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (SDK_INT >= 21) {
ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription("Amaze", ((BitmapDrawable) ContextCompat.getDrawable(this, R.mipmap.ic_launcher)).getBitmap(), getColorPreference().getColor(ColorUsage.getPrimary(MainActivity.currentTab)));
setTaskDescription(taskDescription);
}
getSupportActionBar().setBackgroundDrawable(getColorPreference().getDrawable(ColorUsage.getPrimary(MainActivity.currentTab)));
boolean useNewStack = sharedPref.getBoolean(PreferencesConstants.PREFERENCE_TEXTEDITOR_NEWSTACK, false);
getSupportActionBar().setDisplayHomeAsUpEnabled(!useNewStack);
if (SDK_INT == 20 || SDK_INT == 19) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(getColorPreference().getColor(ColorUsage.getPrimary(MainActivity.currentTab)));
FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.parentdb).getLayoutParams();
SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
p.setMargins(0, config.getStatusBarHeight(), 0, 0);
} else if (SDK_INT >= 21) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(PreferenceUtils.getStatusColor(getColorPreference().getColorAsString(ColorUsage.getPrimary(MainActivity.currentTab))));
if (getBoolean(PREFERENCE_COLORED_NAVIGATION))
window.setNavigationBarColor(PreferenceUtils.getStatusColor(getColorPreference().getColorAsString(ColorUsage.getPrimary(MainActivity.currentTab))));
}
path = getIntent().getStringExtra("path");
pathFile = new File(path);
listView = findViewById(R.id.listView);
load(pathFile);
listView.setOnItemClickListener((parent, view, position, id) -> {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
DbViewerFragment fragment = new DbViewerFragment();
Bundle bundle = new Bundle();
bundle.putString("table", arrayList.get(position));
fragment.setArguments(bundle);
fragmentTransaction.add(R.id.content_frame, fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
});
}
Aggregations