linked: add "retry"
This commit is contained in:
parent
0ef929fb7f
commit
c07e029345
|
@ -9,6 +9,7 @@ python copy OpenKeychain navigation black expand_more 24
|
||||||
python copy OpenKeychain navigation white refresh 24
|
python copy OpenKeychain navigation white refresh 24
|
||||||
python copy OpenKeychain av white repeat 24
|
python copy OpenKeychain av white repeat 24
|
||||||
python copy OpenKeychain av grey repeat 24
|
python copy OpenKeychain av grey repeat 24
|
||||||
|
python copy OpenKeychain av black repeat 24
|
||||||
python copy OpenKeychain editor white mode_edit 24
|
python copy OpenKeychain editor white mode_edit 24
|
||||||
python copy OpenKeychain content white save 24
|
python copy OpenKeychain content white save 24
|
||||||
python copy OpenKeychain navigation black close 24
|
python copy OpenKeychain navigation black close 24
|
||||||
|
|
|
@ -53,6 +53,7 @@ import android.view.ViewGroup;
|
||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.ViewAnimator;
|
import android.widget.ViewAnimator;
|
||||||
|
@ -79,6 +80,8 @@ import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKeyringParcel,EditKeyResult> {
|
public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKeyringParcel,EditKeyResult> {
|
||||||
|
|
||||||
|
private Button mRetryButton;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
IDLE, AUTH_PROCESS, AUTH_ERROR, POST_PROCESS, POST_ERROR, LID_PROCESS, LID_ERROR, DONE
|
IDLE, AUTH_PROCESS, AUTH_ERROR, POST_PROCESS, POST_ERROR, LID_PROCESS, LID_ERROR, DONE
|
||||||
}
|
}
|
||||||
|
@ -114,6 +117,8 @@ public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKe
|
||||||
mStatus2 = (StatusIndicator) view.findViewById(R.id.linked_status_step2);
|
mStatus2 = (StatusIndicator) view.findViewById(R.id.linked_status_step2);
|
||||||
mStatus3 = (StatusIndicator) view.findViewById(R.id.linked_status_step3);
|
mStatus3 = (StatusIndicator) view.findViewById(R.id.linked_status_step3);
|
||||||
|
|
||||||
|
mRetryButton = (Button) view.findViewById(R.id.button_retry);
|
||||||
|
|
||||||
((ImageView) view.findViewById(R.id.linked_id_type_icon)).setImageResource(R.drawable.linked_github);
|
((ImageView) view.findViewById(R.id.linked_id_type_icon)).setImageResource(R.drawable.linked_github);
|
||||||
((ImageView) view.findViewById(R.id.linked_id_certified_icon)).setImageResource(R.drawable.octo_link_24dp);
|
((ImageView) view.findViewById(R.id.linked_id_certified_icon)).setImageResource(R.drawable.octo_link_24dp);
|
||||||
mLinkedIdTitle = (TextView) view.findViewById(R.id.linked_id_title);
|
mLinkedIdTitle = (TextView) view.findViewById(R.id.linked_id_title);
|
||||||
|
@ -403,13 +408,22 @@ public class LinkedIdCreateGithubFragment extends CryptoOperationFragment<SaveKe
|
||||||
@Override
|
@Override
|
||||||
public void onCryptoOperationError(EditKeyResult result) {
|
public void onCryptoOperationError(EditKeyResult result) {
|
||||||
result.createNotify(getActivity()).show(this);
|
result.createNotify(getActivity()).show(this);
|
||||||
mStatus3.setDisplayedChild(3);
|
setState(State.LID_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCryptoOperationCancelled() {
|
public void onCryptoOperationCancelled() {
|
||||||
super.onCryptoOperationCancelled();
|
mRetryButton.setOnClickListener(new OnClickListener() {
|
||||||
mStatus3.setDisplayedChild(3);
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
v.setOnClickListener(null);
|
||||||
|
mButtonContainer.setDisplayedChild(1);
|
||||||
|
setState(State.LID_PROCESS);
|
||||||
|
cryptoOperation();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mButtonContainer.setDisplayedChild(3);
|
||||||
|
setState(State.LID_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String mOAuthCode, mOAuthState;
|
private String mOAuthCode, mOAuthState;
|
||||||
|
|
BIN
OpenKeychain/src/main/res/drawable-hdpi/ic_repeat_black_24dp.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-hdpi/ic_repeat_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 183 B |
BIN
OpenKeychain/src/main/res/drawable-mdpi/ic_repeat_black_24dp.png
Normal file
BIN
OpenKeychain/src/main/res/drawable-mdpi/ic_repeat_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 122 B |
Binary file not shown.
After Width: | Height: | Size: 168 B |
Binary file not shown.
After Width: | Height: | Size: 214 B |
Binary file not shown.
After Width: | Height: | Size: 243 B |
|
@ -129,13 +129,13 @@
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:inAnimation="@anim/fade_in"
|
android:inAnimation="@anim/fade_in"
|
||||||
android:outAnimation="@anim/fade_out"
|
android:outAnimation="@anim/fade_out"
|
||||||
custom:initialView="2">
|
android:clipChildren="false"
|
||||||
|
custom:initialView="3">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
style="?android:buttonBarButtonStyle"
|
|
||||||
android:drawableLeft="@drawable/link_24dp"
|
android:drawableLeft="@drawable/link_24dp"
|
||||||
android:drawableStart="@drawable/link_24dp"
|
android:drawableStart="@drawable/link_24dp"
|
||||||
android:drawablePadding="12dp"
|
android:drawablePadding="12dp"
|
||||||
|
@ -149,6 +149,17 @@
|
||||||
|
|
||||||
<include layout="@layout/linked_id_item" />
|
<include layout="@layout/linked_id_item" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:drawableLeft="@drawable/ic_repeat_black_24dp"
|
||||||
|
android:drawableStart="@drawable/ic_repeat_black_24dp"
|
||||||
|
android:drawablePadding="12dp"
|
||||||
|
android:text="Retry Last Step"
|
||||||
|
android:id="@+id/button_retry"
|
||||||
|
/>
|
||||||
|
|
||||||
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in a new issue