Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve UI/UX around device transfer.
- Loading branch information
1 parent
ace85df
commit 490944a
Showing
24 changed files
with
397 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 16 additions & 4 deletions
20
.../main/java/org/thoughtcrime/securesms/devicetransfer/olddevice/OldDeviceExitActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
package org.thoughtcrime.securesms.devicetransfer.olddevice; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
public class OldDeviceExitActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
finish(); | ||
finishAll(this); | ||
} | ||
|
||
public static void exit(Context context) { | ||
Intent intent = new Intent(context, OldDeviceExitActivity.class); | ||
public static void exit(@NonNull Activity activity) { | ||
Intent intent = new Intent(activity, OldDeviceExitActivity.class); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); | ||
context.startActivity(intent); | ||
activity.startActivity(intent); | ||
finishAll(activity); | ||
} | ||
|
||
private static void finishAll(@NonNull Activity activity) { | ||
if (Build.VERSION.SDK_INT < 21) { | ||
activity.finishAffinity(); | ||
} else { | ||
activity.finishAndRemoveTask(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.