mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Preferences: Import all/Export all has now transparent background and back button works as desired.
This commit is contained in:
@@ -83,7 +83,9 @@ limitations under the License.
|
||||
android:name=".AggregatedStatsActivity"
|
||||
android:label="@string/menu_aggregated_statistics" />
|
||||
<activity android:name=".DeleteActivity" />
|
||||
<activity android:name=".io.file.importer.ImportActivity">
|
||||
<activity
|
||||
android:name=".io.file.importer.ImportActivity"
|
||||
android:theme="@style/ThemeCustomTransparent">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.ATTACH_DATA" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
@@ -128,7 +130,9 @@ limitations under the License.
|
||||
android:name="android.app.default_searchable"
|
||||
android:value=".SearchListActivity" />
|
||||
</activity>
|
||||
<activity android:name=".io.file.exporter.ExportActivity" />
|
||||
<activity
|
||||
android:name=".io.file.exporter.ExportActivity"
|
||||
android:theme="@style/ThemeCustomTransparent" />
|
||||
<activity android:name=".settings.RecordingSettingsActivity" />
|
||||
<activity android:name=".settings.SettingsActivity" />
|
||||
<activity android:name=".settings.StatsSettingsActivity" />
|
||||
|
||||
@@ -70,14 +70,35 @@ public class FileTypeDialogFragment extends AbstractDialogFragment {
|
||||
choices[i] = getString(optionId, trackFileFormat.name(),
|
||||
FileUtils.getPathDisplayName(trackFileFormat.getExtension()));
|
||||
}
|
||||
return new AlertDialog.Builder(getActivity()).setNegativeButton(R.string.generic_cancel, null)
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setCancelable(true)
|
||||
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
onDismissed();
|
||||
}
|
||||
})
|
||||
.setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
|
||||
caller.onFileTypeDone(TrackFileFormat.values()[position]);
|
||||
}
|
||||
}).setSingleChoiceItems(choices, 0, null).setTitle(titleId).create();
|
||||
})
|
||||
.setSingleChoiceItems(choices, 0, null)
|
||||
.setTitle(titleId)
|
||||
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
onDismissed();
|
||||
}
|
||||
})
|
||||
.create();
|
||||
}
|
||||
|
||||
protected void onDismissed() {
|
||||
dismiss();
|
||||
caller.onDismissed();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,5 +112,7 @@ public class FileTypeDialogFragment extends AbstractDialogFragment {
|
||||
* Called when file type selection is done.
|
||||
*/
|
||||
void onFileTypeDone(TrackFileFormat trackFileFormat);
|
||||
|
||||
void onDismissed();
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,11 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismissed() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
@@ -103,6 +108,7 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
saveAsyncTask.cancel(true);
|
||||
dialog.dismiss();
|
||||
onDismissed();
|
||||
}
|
||||
}, directoryDisplayName);
|
||||
return progressDialog;
|
||||
@@ -129,13 +135,13 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
onDismissed();
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int arg1) {
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
onDismissed();
|
||||
}
|
||||
}).setTitle(titleId);
|
||||
final Dialog dialog = builder.create();
|
||||
|
||||
@@ -102,6 +102,11 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismissed() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
@@ -112,6 +117,7 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
importAsyncTask.cancel(true);
|
||||
dialog.dismiss();
|
||||
onDismissed();
|
||||
}
|
||||
}, directoryDisplayName);
|
||||
return progressDialog;
|
||||
@@ -142,13 +148,13 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
dialogInterface.dismiss();
|
||||
finish();
|
||||
onDismissed();
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int which) {
|
||||
dialogInterface.dismiss();
|
||||
finish();
|
||||
onDismissed();
|
||||
}
|
||||
}).setTitle(titleId).create();
|
||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
|
||||
@@ -32,6 +32,16 @@ limitations under the License.
|
||||
<item name="android:alertDialogTheme">@style/CustomAlertDialogTheme</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeCustomTransparent" parent="ThemeCustom">
|
||||
<!-- TODO Remove when moving to settings to fragments. -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomAlertDialogTheme" parent="@android:style/Theme.Holo.Dialog">
|
||||
<!-- From auto generated -->
|
||||
<item name="android:activatedBackgroundIndicator">@drawable/activated_background_holo_dark
|
||||
|
||||
Reference in New Issue
Block a user