From: Nathaniel Wesley Filardo Date: Fri, 29 Jan 2016 07:25:34 +0000 (-0500) Subject: Commit example code generated by Studio X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=313fd0884d4feb302b74e7f604053f210ede2125;p=acmetensortoys-teled Commit example code generated by Studio --- 313fd0884d4feb302b74e7f604053f210ede2125 diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..e0b366a --- /dev/null +++ b/build.gradle @@ -0,0 +1,23 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.0' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/mobile/.gitignore b/mobile/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/mobile/.gitignore @@ -0,0 +1 @@ +/build diff --git a/mobile/build.gradle b/mobile/build.gradle new file mode 100644 index 0000000..11d0d79 --- /dev/null +++ b/mobile/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + applicationId "com.acmetensortoys.android.teled" + minSdkVersion 19 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + wearApp project(':wear') + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.google.android.gms:play-services:8.4.0' + compile 'com.android.support:design:23.1.1' +} diff --git a/mobile/proguard-rules.pro b/mobile/proguard-rules.pro new file mode 100644 index 0000000..23c6bbc --- /dev/null +++ b/mobile/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/nwf/Android/Sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/mobile/src/androidTest/java/com/acmetensortoys/android/teled/ApplicationTest.java b/mobile/src/androidTest/java/com/acmetensortoys/android/teled/ApplicationTest.java new file mode 100644 index 0000000..be7afe1 --- /dev/null +++ b/mobile/src/androidTest/java/com/acmetensortoys/android/teled/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.acmetensortoys.android.teled; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ad8d914 --- /dev/null +++ b/mobile/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/mobile/src/main/java/com/acmetensortoys/android/teled/MainActivity.java b/mobile/src/main/java/com/acmetensortoys/android/teled/MainActivity.java new file mode 100644 index 0000000..284a3ab --- /dev/null +++ b/mobile/src/main/java/com/acmetensortoys/android/teled/MainActivity.java @@ -0,0 +1,101 @@ +package com.acmetensortoys.android.teled; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.view.View; +import android.support.design.widget.NavigationView; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; + +public class MainActivity extends AppCompatActivity + implements NavigationView.OnNavigationItemSelectedListener { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + drawer.setDrawerListener(toggle); + toggle.syncState(); + + NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + navigationView.setNavigationItemSelectedListener(this); + } + + @Override + public void onBackPressed() { + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + if (drawer.isDrawerOpen(GravityCompat.START)) { + drawer.closeDrawer(GravityCompat.START); + } else { + super.onBackPressed(); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_scrolling, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } + + @SuppressWarnings("StatementWithEmptyBody") + @Override + public boolean onNavigationItemSelected(MenuItem item) { + // Handle navigation view item clicks here. + int id = item.getItemId(); + + if (id == R.id.nav_camera) { + // Handle the camera action + } else if (id == R.id.nav_gallery) { + + } else if (id == R.id.nav_slideshow) { + + } else if (id == R.id.nav_manage) { + + } else if (id == R.id.nav_share) { + + } else if (id == R.id.nav_send) { + + } + + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + drawer.closeDrawer(GravityCompat.START); + return true; + } +} diff --git a/mobile/src/main/res/drawable-v21/ic_menu_camera.xml b/mobile/src/main/res/drawable-v21/ic_menu_camera.xml new file mode 100644 index 0000000..0d9ea10 --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_camera.xml @@ -0,0 +1,12 @@ + + + + diff --git a/mobile/src/main/res/drawable-v21/ic_menu_gallery.xml b/mobile/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100644 index 0000000..f6872c4 --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ + + + diff --git a/mobile/src/main/res/drawable-v21/ic_menu_manage.xml b/mobile/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100644 index 0000000..c1be60b --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/mobile/src/main/res/drawable-v21/ic_menu_send.xml b/mobile/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100644 index 0000000..00c668c --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ + + + diff --git a/mobile/src/main/res/drawable-v21/ic_menu_share.xml b/mobile/src/main/res/drawable-v21/ic_menu_share.xml new file mode 100644 index 0000000..a28fb9e --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_share.xml @@ -0,0 +1,9 @@ + + + diff --git a/mobile/src/main/res/drawable-v21/ic_menu_slideshow.xml b/mobile/src/main/res/drawable-v21/ic_menu_slideshow.xml new file mode 100644 index 0000000..209aa64 --- /dev/null +++ b/mobile/src/main/res/drawable-v21/ic_menu_slideshow.xml @@ -0,0 +1,9 @@ + + + diff --git a/mobile/src/main/res/drawable/side_nav_bar.xml b/mobile/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..458b4b0 --- /dev/null +++ b/mobile/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/mobile/src/main/res/layout/activity_main.xml b/mobile/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..a61d8a6 --- /dev/null +++ b/mobile/src/main/res/layout/activity_main.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/mobile/src/main/res/layout/app_bar_main.xml b/mobile/src/main/res/layout/app_bar_main.xml new file mode 100644 index 0000000..e00e4f7 --- /dev/null +++ b/mobile/src/main/res/layout/app_bar_main.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/mobile/src/main/res/layout/content_scrolling.xml b/mobile/src/main/res/layout/content_scrolling.xml new file mode 100644 index 0000000..5a22ef5 --- /dev/null +++ b/mobile/src/main/res/layout/content_scrolling.xml @@ -0,0 +1,19 @@ + + + + + diff --git a/mobile/src/main/res/layout/nav_header_main.xml b/mobile/src/main/res/layout/nav_header_main.xml new file mode 100644 index 0000000..fcc84ca --- /dev/null +++ b/mobile/src/main/res/layout/nav_header_main.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/mobile/src/main/res/menu/activity_main_drawer.xml b/mobile/src/main/res/menu/activity_main_drawer.xml new file mode 100644 index 0000000..2a7f467 --- /dev/null +++ b/mobile/src/main/res/menu/activity_main_drawer.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/mobile/src/main/res/menu/menu_scrolling.xml b/mobile/src/main/res/menu/menu_scrolling.xml new file mode 100644 index 0000000..a2411e3 --- /dev/null +++ b/mobile/src/main/res/menu/menu_scrolling.xml @@ -0,0 +1,9 @@ + + + + diff --git a/mobile/src/main/res/mipmap-hdpi/ic_launcher.png b/mobile/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..cde69bc Binary files /dev/null and b/mobile/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-mdpi/ic_launcher.png b/mobile/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c133a0c Binary files /dev/null and b/mobile/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..bfa42f0 Binary files /dev/null and b/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..324e72c Binary files /dev/null and b/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..aee44e1 Binary files /dev/null and b/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/mobile/src/main/res/values-v21/styles.xml b/mobile/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..251fb9f --- /dev/null +++ b/mobile/src/main/res/values-v21/styles.xml @@ -0,0 +1,9 @@ +> + + + diff --git a/mobile/src/main/res/values-w820dp/dimens.xml b/mobile/src/main/res/values-w820dp/dimens.xml new file mode 100644 index 0000000..63fc816 --- /dev/null +++ b/mobile/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,6 @@ + + + 64dp + diff --git a/mobile/src/main/res/values/colors.xml b/mobile/src/main/res/values/colors.xml new file mode 100644 index 0000000..3ab3e9c --- /dev/null +++ b/mobile/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #3F51B5 + #303F9F + #FF4081 + diff --git a/mobile/src/main/res/values/dimens.xml b/mobile/src/main/res/values/dimens.xml new file mode 100644 index 0000000..c2effc5 --- /dev/null +++ b/mobile/src/main/res/values/dimens.xml @@ -0,0 +1,9 @@ + + + 16dp + 160dp + + 16dp + 16dp + 16dp + diff --git a/mobile/src/main/res/values/drawables.xml b/mobile/src/main/res/values/drawables.xml new file mode 100644 index 0000000..52c6a6c --- /dev/null +++ b/mobile/src/main/res/values/drawables.xml @@ -0,0 +1,8 @@ + + @android:drawable/ic_menu_camera + @android:drawable/ic_menu_gallery + @android:drawable/ic_menu_slideshow + @android:drawable/ic_menu_manage + @android:drawable/ic_menu_share + @android:drawable/ic_menu_send + diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml new file mode 100644 index 0000000..3bc5066 --- /dev/null +++ b/mobile/src/main/res/values/strings.xml @@ -0,0 +1,8 @@ + + TeleD + + Open navigation drawer + Close navigation drawer + + Settings + diff --git a/mobile/src/main/res/values/styles.xml b/mobile/src/main/res/values/styles.xml new file mode 100644 index 0000000..545b9c6 --- /dev/null +++ b/mobile/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + +