Skip to content

Commit 647d619

Browse files
committed
show git hash on first screen when starting up
1 parent d983850 commit 647d619

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/SetPasswordActivity.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class SetPasswordActivity extends AppCompatActivity
5050
private check_user_password_criteria mAuthTask = null;
5151

5252
// UI references.
53+
private TextView githash_text;
5354
private EditText mPasswordView1;
5455
private EditText mPasswordView2;
5556
private View mProgressView;
@@ -68,6 +69,8 @@ protected void onCreate(Bundle savedInstanceState)
6869

6970
settings = PreferenceManager.getDefaultSharedPreferences(this);
7071

72+
githash_text = findViewById(R.id.githash_text);
73+
7174
mPasswordView1 = (EditText) findViewById(R.id.password_1);
7275
mPasswordView1.setOnEditorActionListener(new TextView.OnEditorActionListener()
7376
{
@@ -116,6 +119,24 @@ public void onClick(View view)
116119

117120
mLoginFormView = findViewById(R.id.login_form);
118121
mProgressView = findViewById(R.id.login_progress);
122+
123+
try
124+
{
125+
githash_text.setText("build: ????????");
126+
}
127+
catch(Exception e)
128+
{
129+
130+
}
131+
132+
try
133+
{
134+
githash_text.setText("build: " + BuildConfig.GitHash);
135+
}
136+
catch(Exception e)
137+
{
138+
139+
}
119140
}
120141

121142
void auto_create_password()

android-refimpl-app/app/src/main/res/layout/activity_set_password.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,25 @@
3333
android:layout_height="60dp"
3434
android:src="@drawable/web_hi_res_512" />
3535

36+
<TextView
37+
style="?android:textAppearanceSmall"
38+
android:id="@+id/githash_text"
39+
android:layout_width="match_parent"
40+
android:layout_height="wrap_content"
41+
android:layout_marginTop="2dp"
42+
android:layout_marginBottom="0dp"
43+
android:gravity="center"
44+
android:textSize="14sp"
45+
android:paddingLeft="2dp"
46+
android:paddingRight="2dp"
47+
android:text="build: ????????"
48+
android:textColor="@color/md_grey_900" />
49+
3650
<TextView
3751
style="?android:textAppearanceMedium"
3852
android:layout_width="match_parent"
3953
android:layout_height="wrap_content"
40-
android:layout_marginTop="10dp"
54+
android:layout_marginTop="4dp"
4155
android:layout_marginBottom="10dp"
4256
android:gravity="center"
4357
android:paddingLeft="10dp"

0 commit comments

Comments
 (0)