mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-27 01:32:06 +02:00
Hide the "merge old activity database" elements when there is no old db
This commit is contained in:
parent
9928ad80c4
commit
afef50dfab
@ -68,7 +68,16 @@ public class DbManagementActivity extends GBActivity {
|
||||
}
|
||||
});
|
||||
|
||||
boolean hasOldDB = hasOldActivityDatabase();
|
||||
int oldDBVisibility = hasOldDB ? View.VISIBLE : View.GONE;
|
||||
|
||||
View oldDBTitle = findViewById(R.id.mergeOldActivityDataTitle);
|
||||
oldDBTitle.setVisibility(oldDBVisibility);
|
||||
View oldDBText = findViewById(R.id.mergeOldActivityDataText);
|
||||
oldDBText.setVisibility(oldDBVisibility);
|
||||
|
||||
importOldActivityDataButton = (Button) findViewById(R.id.mergeOldActivityData);
|
||||
importOldActivityDataButton.setVisibility(oldDBVisibility);
|
||||
importOldActivityDataButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -77,6 +86,7 @@ public class DbManagementActivity extends GBActivity {
|
||||
});
|
||||
|
||||
deleteOldActivityDBButton = (Button) findViewById(R.id.deleteOldActivityDB);
|
||||
deleteOldActivityDBButton.setVisibility(oldDBVisibility);
|
||||
deleteOldActivityDBButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -93,6 +103,10 @@ public class DbManagementActivity extends GBActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private boolean hasOldActivityDatabase() {
|
||||
return new DBHelper(this).getOldActivityDatabaseHandler() != null;
|
||||
}
|
||||
|
||||
private String getExternalPath() {
|
||||
try {
|
||||
return FileUtils.getExternalFilesDir().getAbsolutePath();
|
||||
|
Loading…
Reference in New Issue
Block a user