From: Damyan Ivanov Date: Fri, 14 Dec 2018 20:56:52 +0000 (+0000) Subject: start the Transaction list activity not really a thing yet X-Git-Tag: v0.3~238 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=ce34e7c2b46cc78021d9b93f6b82b73bb1bc432a start the Transaction list activity not really a thing yet --- diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 926fc763..deefabf1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,12 +6,12 @@ + android:theme="@style/AppTheme"> + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java index 91829498..58cdad09 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java +++ b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java @@ -182,7 +182,10 @@ public class AccountSummary extends AppCompatActivity { Intent intent = new Intent(this, SettingsActivity.class); startActivity(intent); } - + public void onLatestTransactionsClicked(View view) { + Intent intent = new Intent(this, TransactionListActivity.class); + startActivity(intent); + } @Override public void onBackPressed() { DrawerLayout drawer = findViewById(R.id.drawer_layout); diff --git a/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java new file mode 100644 index 00000000..a948715e --- /dev/null +++ b/app/src/main/java/net/ktnx/mobileledger/TransactionListActivity.java @@ -0,0 +1,56 @@ +/* + * Copyright © 2018 Damyan Ivanov. + * This file is part of Mobile-Ledger. + * Mobile-Ledger is free software: you can distribute it and/or modify it + * under the term of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your opinion), any later version. + * + * Mobile-Ledger is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License terms for details. + * + * You should have received a copy of the GNU General Public License + * along with Mobile-Ledger. If not, see . + */ + +package net.ktnx.mobileledger; + +import android.os.Bundle; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; + +import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment; + +public class TransactionListActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.transaction_list_activity); + if (savedInstanceState == null) { + getSupportFragmentManager().beginTransaction() + .replace(R.id.container, TransactionListFragment.newInstance()).commitNow(); + } + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + setupActionBar(); + } + private void setupActionBar() { + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + // Show the Up button in the action bar. + actionBar.setDisplayHomeAsUpEnabled(true); + } + } + @Override + public void finish() { + super.finish(); + Log.d("visuals", "finishing"); + overridePendingTransition(R.anim.dummy, R.anim.slide_out_right); + } +} diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java new file mode 100644 index 00000000..8cd758f7 --- /dev/null +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java @@ -0,0 +1,51 @@ +/* + * Copyright © 2018 Damyan Ivanov. + * This file is part of Mobile-Ledger. + * Mobile-Ledger is free software: you can distribute it and/or modify it + * under the term of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your opinion), any later version. + * + * Mobile-Ledger is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License terms for details. + * + * You should have received a copy of the GNU General Public License + * along with Mobile-Ledger. If not, see . + */ + +package net.ktnx.mobileledger.ui.transaction_list; + +import android.arch.lifecycle.ViewModelProviders; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import net.ktnx.mobileledger.R; + +public class TransactionListFragment extends Fragment { + + private TransactionListViewModel mViewModel; + public static TransactionListFragment newInstance() { + return new TransactionListFragment(); + } + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.transaction_list_fragment, container, false); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mViewModel = ViewModelProviders.of(this).get(TransactionListViewModel.class); + // TODO: Use the ViewModel + } + +} diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java new file mode 100644 index 00000000..10aa2e9b --- /dev/null +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java @@ -0,0 +1,24 @@ +/* + * Copyright © 2018 Damyan Ivanov. + * This file is part of Mobile-Ledger. + * Mobile-Ledger is free software: you can distribute it and/or modify it + * under the term of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your opinion), any later version. + * + * Mobile-Ledger is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License terms for details. + * + * You should have received a copy of the GNU General Public License + * along with Mobile-Ledger. If not, see . + */ + +package net.ktnx.mobileledger.ui.transaction_list; + +import android.arch.lifecycle.ViewModel; + +public class TransactionListViewModel extends ViewModel { + // TODO: Implement the ViewModel +} diff --git a/app/src/main/res/layout/drawer.xml b/app/src/main/res/layout/drawer.xml index ac52cd69..f422e173 100644 --- a/app/src/main/res/layout/drawer.xml +++ b/app/src/main/res/layout/drawer.xml @@ -53,6 +53,7 @@ android:id="@+id/nav_latest_transactions" style="@style/nav_button" android:drawableStart="@drawable/ic_event_note_black_24dp" + android:onClick="onLatestTransactionsClicked" android:text="@string/nav_latest_transactions_title" /> + + + + + + + + + + + diff --git a/app/src/main/res/layout/transaction_list_fragment.xml b/app/src/main/res/layout/transaction_list_fragment.xml new file mode 100644 index 00000000..e76ff29b --- /dev/null +++ b/app/src/main/res/layout/transaction_list_fragment.xml @@ -0,0 +1,37 @@ + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f0f61077..c6d1d8a6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -99,4 +99,5 @@ Hide selected accounts Cancel selection Confirm selectin + Transactions