Added support buttons

This commit is contained in:
M66B 2019-12-25 11:49:34 +01:00
parent 0f9f1b4ec6
commit 3a9dc2f153
4 changed files with 51 additions and 4 deletions

View File

@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.provider.ContactsContract;
@ -64,6 +65,8 @@ public class FragmentGmail extends FragmentBase {
private ContentLoadingProgressBar pbSelect;
private TextView tvError;
private Button btnSupport;
private Group grpError;
@Override
@ -83,6 +86,8 @@ public class FragmentGmail extends FragmentBase {
pbSelect = view.findViewById(R.id.pbSelect);
tvError = view.findViewById(R.id.tvError);
btnSupport = view.findViewById(R.id.btnSupport);
grpError = view.findViewById(R.id.grpError);
// Wire controls
@ -120,6 +125,13 @@ public class FragmentGmail extends FragmentBase {
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.view(getContext(), Uri.parse(Helper.FAQ_URI + "#user-content-authorizing-accounts"), false);
}
});
// Initialize
Helper.setViewsEnabled(view, false);
pbSelect.setVisibility(View.GONE);

View File

@ -89,8 +89,10 @@ public class FragmentOAuth extends FragmentBase {
private TextView tvGmailHint;
private TextView tvError;
private Group grpError;
private TextView tvGmailDraftsHint;
private Button btnSupport;
private Group grpError;
private static final int OAUTH_TIMEOUT = 20 * 1000; // milliseconds
@ -120,8 +122,10 @@ public class FragmentOAuth extends FragmentBase {
tvGmailHint = view.findViewById(R.id.tvGmailHint);
tvError = view.findViewById(R.id.tvError);
grpError = view.findViewById(R.id.grpError);
tvGmailDraftsHint = view.findViewById(R.id.tvGmailDraftsHint);
btnSupport = view.findViewById(R.id.btnSupport);
grpError = view.findViewById(R.id.grpError);
// Wire controls
@ -132,6 +136,13 @@ public class FragmentOAuth extends FragmentBase {
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.view(getContext(), Uri.parse(Helper.FAQ_URI + "#user-content-authorizing-accounts"), false);
}
});
// Initialize
tvGrantHint.setText(getString(R.string.title_setup_oauth_rationale, name));
pbOAuth.setVisibility(View.GONE);

View File

@ -128,10 +128,22 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorAccent"
android:text="@string/menu_faq"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDraftsHint" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError,tvDraftsHint" />
app:constraint_referenced_ids="tvErrorTitle,tvError,tvDraftsHint,btnSupport" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@ -103,10 +103,22 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorAccent"
android:text="@string/menu_faq"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvGmailDraftsHint" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
app:constraint_referenced_ids="tvErrorTitle,tvError,btnSupport" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>