Skip to content

Commit a8a471d

Browse files
Add button navigating to https://id.arduino.cc web page
1 parent dbe60b8 commit a8a471d

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

OpenScienceJournal/whistlepunk_library/src/main/java/com/google/android/apps/forscience/whistlepunk/signin/ArduinoSettingsActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.annotation.SuppressLint;
44
import android.content.Intent;
5+
import android.net.Uri;
56
import android.os.Bundle;
67
import android.view.View;
78
import android.widget.CompoundButton;
@@ -63,6 +64,7 @@ protected void onCreate(Bundle savedInstanceState) {
6364
mSyncSwitch = findViewById(R.id.section_google_drive_switch);
6465
mSyncSwitch.setOnCheckedChangeListener(mSwitchListener);
6566
findViewById(R.id.section_google_drive_switch_change).setOnClickListener(v -> startActivity(new Intent(this, GDriveSyncSetupActivity.class)));
67+
findViewById(R.id.redirect_to_id_page_image_view).setOnClickListener(v -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://id.arduino.cc"))));
6668
}
6769

6870
@Override

OpenScienceJournal/whistlepunk_library/src/main/res/layout/activity_arduino_auth_settings.xml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,39 @@
9191
android:layout_width="0dp"
9292
android:layout_height="wrap_content"
9393
android:layout_marginTop="15dp"
94+
android:layout_marginEnd="15dp"
9495
android:fontFamily="@font/open_sans"
9596
android:textColor="@color/arduino_gris"
9697
android:textSize="16sp"
97-
app:layout_constraintEnd_toEndOf="parent"
98+
app:layout_constraintEnd_toStartOf="@id/redirect_to_id_page_image_view"
9899
app:layout_constraintStart_toStartOf="parent"
99-
app:layout_constraintTop_toBottomOf="@id/section_arduino_account" />
100+
app:layout_constraintTop_toBottomOf="@id/section_arduino_account"
101+
tools:text="Lil Nickname" />
100102

101103
<TextView
102104
android:id="@+id/section_arduino_account_email"
103105
android:layout_width="0dp"
104106
android:layout_height="wrap_content"
105107
android:layout_marginTop="2.5dp"
108+
android:layout_marginEnd="15dp"
106109
android:fontFamily="@font/open_sans_bold"
107110
android:textColor="@color/arduino_gris"
108111
android:textSize="12sp"
109-
app:layout_constraintEnd_toEndOf="parent"
112+
app:layout_constraintEnd_toStartOf="@id/redirect_to_id_page_image_view"
110113
app:layout_constraintStart_toStartOf="parent"
111-
app:layout_constraintTop_toBottomOf="@id/section_arduino_account_nickname" />
114+
app:layout_constraintTop_toBottomOf="@id/section_arduino_account_nickname"
115+
tools:text="account@email.com" />
116+
117+
<ImageButton
118+
android:id="@+id/redirect_to_id_page_image_view"
119+
android:layout_width="wrap_content"
120+
android:layout_height="wrap_content"
121+
android:background="?selectableItemBackgroundBorderless"
122+
android:padding="8dp"
123+
android:src="@drawable/ic_external"
124+
app:layout_constraintBottom_toBottomOf="@id/section_arduino_account_email"
125+
app:layout_constraintEnd_toEndOf="parent"
126+
app:layout_constraintTop_toTopOf="@id/section_arduino_account_nickname" />
112127

113128
<androidx.constraintlayout.widget.ConstraintLayout
114129
android:id="@+id/section_google_drive_sync_layout"

0 commit comments

Comments
 (0)