]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java
start the new transaction interface
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / LatestTransactions.java
index 3cd6e10aaa5fdff51fda7b9ac32c539182d1d13c..98391f29f04d2fcd9a1a86ffc01efb852ffd5ac7 100644 (file)
@@ -1,9 +1,8 @@
 package net.ktnx.mobileledger;
 
+import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.os.Bundle;
-import android.support.design.widget.FloatingActionButton;
-import android.support.design.widget.Snackbar;
 import android.support.v4.view.GravityCompat;
 import android.support.v4.widget.DrawerLayout;
 import android.support.v7.app.ActionBarDrawerToggle;
@@ -23,15 +22,6 @@ public class LatestTransactions extends AppCompatActivity {
         Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
 
-        FloatingActionButton fab = findViewById(R.id.btn_add_transaction);
-        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 = findViewById(R.id.drawer_layout);
         ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                 this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
@@ -44,15 +34,24 @@ public class LatestTransactions extends AppCompatActivity {
             PackageInfo pi = getApplicationContext().getPackageManager().getPackageInfo(getPackageName(), 0);
             ver.setText(pi.versionName);
         } catch (Exception e) {
-            ver.setText("version");
         }
     }
 
+    public void fab_new_transaction_clicked(View view) {
+        Intent intent = new Intent(this, NewTransactionActivity.class);
+        startActivity(intent);
+    }
+
     public void nav_exit_clicked(View view) {
         Log.w("mobileledger", "exiting");
         finish();
     }
 
+    public void nav_settings_clicked(View view) {
+        Intent intent = new Intent(this, SettingsActivity.class);
+        startActivity(intent);
+    }
+
     @Override
     public void onBackPressed() {
         DrawerLayout drawer = findViewById(R.id.drawer_layout);
@@ -66,7 +65,7 @@ public class LatestTransactions extends AppCompatActivity {
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         // Inflate the menu; this adds items to the action bar if it is present.
-        getMenuInflater().inflate(R.menu.latest_transactions, menu);
+        //getMenuInflater().inflate(R.menu.latest_transactions, menu);
         return true;
     }
 
@@ -78,9 +77,9 @@ public class LatestTransactions extends AppCompatActivity {
         int id = item.getItemId();
 
         //noinspection SimplifiableIfStatement
-        if (id == R.id.action_settings) {
-            return true;
-        }
+        //if (id == R.id.action_settings) {
+        //    return true;
+        // }
 
         return super.onOptionsItemSelected(item);
     }