From: Nathaniel Wesley Filardo Date: Fri, 10 Feb 2017 07:12:47 +0000 (-0500) Subject: Further UI improvements X-Git-Tag: release-1.2~56 X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=d21351710b4b16cb8894ea9b954af58d8447db75;p=acmetensortoys-ctfws-android Further UI improvements Notably, an About screen --- diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index ba66053..b23d07b 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -9,13 +9,10 @@ - - + @@ -28,6 +25,8 @@ + + \ No newline at end of file diff --git a/mobile/src/main/ic_kgb_logo-web.png b/mobile/src/main/ic_kgb_logo-web.png new file mode 100644 index 0000000..34314bb Binary files /dev/null and b/mobile/src/main/ic_kgb_logo-web.png differ diff --git a/mobile/src/main/ic_shield_1-web.png b/mobile/src/main/ic_shield_1-web.png new file mode 100644 index 0000000..34314bb Binary files /dev/null and b/mobile/src/main/ic_shield_1-web.png differ diff --git a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/AboutActivity.java b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/AboutActivity.java new file mode 100644 index 0000000..bfde6ae --- /dev/null +++ b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/AboutActivity.java @@ -0,0 +1,34 @@ +package com.acmetensortoys.ctfwstimer; + +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.net.Uri; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.webkit.WebView; + +public class AboutActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + + View iv = findViewById(R.id.about_image); + iv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + try { + startActivity(new Intent(Intent.ACTION_VIEW, + Uri.parse("http://www.cmukgb.org/"))); + } catch (ActivityNotFoundException anfe) { + // NOP + } + } + }); + + final WebView wv = (WebView) findViewById(R.id.about_text); + wv.loadData(getResources().getString(R.string.about_text), "text/html", null); + } +} diff --git a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainActivity.java b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainActivity.java index 2c5c0de..1118c29 100644 --- a/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainActivity.java +++ b/mobile/src/main/java/com/acmetensortoys/ctfwstimer/MainActivity.java @@ -1,5 +1,7 @@ package com.acmetensortoys.ctfwstimer; +import android.annotation.SuppressLint; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Handler; import android.support.annotation.Nullable; @@ -11,6 +13,7 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import android.view.View; import android.widget.TextView; import org.eclipse.paho.android.service.MqttAndroidClient; @@ -189,6 +192,19 @@ public class MainActivity extends AppCompatActivity { } } + private boolean egg = false; + @SuppressLint({"SetTextI18n"}) + public void onclick_gamestate(View v) { + TextView tv = (TextView) v; + if (egg) { + tv.setText(R.string.header_gamestate); + } else { + ((TextView) v).setText("DO NOT TAP ON GLASS"); + } + egg = !egg; + } + + // TODO should we be using onClick instead for routing? @Override public boolean onOptionsItemSelected(MenuItem mi) { switch(mi.getItemId()) { @@ -198,6 +214,9 @@ public class MainActivity extends AppCompatActivity { R.layout.server_dialog, R.id.server_text, "server"); d.show(getSupportFragmentManager(),"serverdialog"); return true; + case R.id.menu_about : + startActivity(new Intent(this, AboutActivity.class)); + return true; default: return super.onOptionsItemSelected(mi); } diff --git a/mobile/src/main/res/drawable/shield1.png b/mobile/src/main/res/drawable/shield1.png new file mode 100644 index 0000000..309ca72 Binary files /dev/null and b/mobile/src/main/res/drawable/shield1.png differ diff --git a/mobile/src/main/res/layout/activity_about.xml b/mobile/src/main/res/layout/activity_about.xml new file mode 100644 index 0000000..029c524 --- /dev/null +++ b/mobile/src/main/res/layout/activity_about.xml @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/mobile/src/main/res/layout/activity_main.xml b/mobile/src/main/res/layout/activity_main.xml index 349ad30..a6cb634 100644 --- a/mobile/src/main/res/layout/activity_main.xml +++ b/mobile/src/main/res/layout/activity_main.xml @@ -11,234 +11,223 @@ + android:layout_height="wrap_content"> - + android:layout_height="match_parent" + android:id="@+id/tbl_opts" + android:stretchColumns="1"> - + - + - - - + android:layout_height="match_parent"> - - - - - - - - - + android:id="@+id/notif_wear" + android:layout_weight="1" /> - - - - - - - + android:id="@+id/notif_here" + android:layout_weight="1" /> + - + - + - + + --> - - + - + android:layout_height="match_parent" + android:stretchColumns="1"> - + android:paddingBottom="1dp"> - - - - - + - + + + - + + + android:gravity="center" + android:paddingBottom="1dp" + android:paddingTop="1dp"> + + - + android:layout_height="wrap_content" + android:id="@+id/pb_gameProgress" + android:layout_weight="1" + android:indeterminate="false" + android:padding="5dp" /> - + - - + + + + + - + android:layout_height="wrap_content" + android:id="@+id/tv_flags" + android:gravity="center" /> - + - + - + - - + + + + + + - - diff --git a/mobile/src/main/res/menu/mainmenu.xml b/mobile/src/main/res/menu/mainmenu.xml index 04f1e79..0c6a9f0 100644 --- a/mobile/src/main/res/menu/mainmenu.xml +++ b/mobile/src/main/res/menu/mainmenu.xml @@ -6,5 +6,12 @@ android:enabled="true" android:title="@string/menutext_mqtt" android:id="@+id/menu_mqtt" - android:icon="@android:drawable/ic_menu_manage" /> + android:icon="@android:drawable/ic_menu_manage" + android:checkable="false" /> + \ No newline at end of file diff --git a/mobile/src/main/res/mipmap-hdpi/ic_launcher.png b/mobile/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bc..0000000 Binary files a/mobile/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/mobile/src/main/res/mipmap-hdpi/ic_shield_1.png b/mobile/src/main/res/mipmap-hdpi/ic_shield_1.png new file mode 100644 index 0000000..0e349f1 Binary files /dev/null and b/mobile/src/main/res/mipmap-hdpi/ic_shield_1.png differ diff --git a/mobile/src/main/res/mipmap-mdpi/ic_launcher.png b/mobile/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0c..0000000 Binary files a/mobile/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/mobile/src/main/res/mipmap-mdpi/ic_shield_1.png b/mobile/src/main/res/mipmap-mdpi/ic_shield_1.png new file mode 100644 index 0000000..7f7efda Binary files /dev/null and b/mobile/src/main/res/mipmap-mdpi/ic_shield_1.png differ diff --git a/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0..0000000 Binary files a/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/mobile/src/main/res/mipmap-xhdpi/ic_shield_1.png b/mobile/src/main/res/mipmap-xhdpi/ic_shield_1.png new file mode 100644 index 0000000..6058a1f Binary files /dev/null and b/mobile/src/main/res/mipmap-xhdpi/ic_shield_1.png differ diff --git a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72c..0000000 Binary files a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/mobile/src/main/res/mipmap-xxhdpi/ic_shield_1.png b/mobile/src/main/res/mipmap-xxhdpi/ic_shield_1.png new file mode 100644 index 0000000..4e07e72 Binary files /dev/null and b/mobile/src/main/res/mipmap-xxhdpi/ic_shield_1.png differ diff --git a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index aee44e1..0000000 Binary files a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/mobile/src/main/res/mipmap-xxxhdpi/ic_shield_1.png b/mobile/src/main/res/mipmap-xxxhdpi/ic_shield_1.png new file mode 100644 index 0000000..4cd7cbb Binary files /dev/null and b/mobile/src/main/res/mipmap-xxxhdpi/ic_shield_1.png differ diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml index 82df3b7..8d98c32 100644 --- a/mobile/src/main/res/values/strings.xml +++ b/mobile/src/main/res/values/strings.xml @@ -13,6 +13,7 @@ OK Cancel + About Set MQTT Server Server URI: @@ -23,4 +24,16 @@ Subscribed <<null>> + + + Capture The Flag With Stuff Rules +
+ This project is open source under AGPLv3; see the + GitHub Project Page +
+ © 2017 Nathaniel Wesley Filardo and others + + ]]> +