diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e7610e..92f1721 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -27,18 +27,14 @@ - + android:value="io.github.zkhan93.familyfinance.HomeActivity" /> + android:value="io.github.zkhan93.familyfinance.HomeActivity" /> + android:value="io.github.zkhan93.familyfinance.HomeActivity" /> + android:value="io.github.zkhan93.familyfinance.HomeActivity" /> + android:value="io.github.zkhan93.familyfinance.HomeActivity" /> { Util.Log.d(TAG, "click: %s", id); +// TODO: probably we have to ignore the first trigger if (id.equals(TAG)) DialogFragmentCcard.newInstance(familyId).show(getParentFragmentManager(), DialogFragmentCcard.TAG); @@ -109,7 +110,13 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat @Override public void onResume() { super.onResume(); - appState.getFabActionID().setValue(TAG); + showFab(); + } + + @Override + public void onPause() { + super.onPause(); + appState.disableFab(); } @Override @@ -135,16 +142,8 @@ public void onStop() { } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - return super.onOptionsItemSelected(item); - - } - - private void setUpFab(){ - appState = new ViewModelProvider(requireActivity()).get(AppState.class); - appState.getFabIcon().setValue(R.drawable.ic_add_white_24dp); - appState.getFabShow().setValue(true); + private void showFab() { + appState.enableFab(R.drawable.ic_add_white_24dp, TAG); } @Override diff --git a/app/src/main/java/io/github/zkhan93/familyfinance/MainActivity.java b/app/src/main/java/io/github/zkhan93/familyfinance/MainActivity.java deleted file mode 100644 index 4ad811f..0000000 --- a/app/src/main/java/io/github/zkhan93/familyfinance/MainActivity.java +++ /dev/null @@ -1,555 +0,0 @@ -package io.github.zkhan93.familyfinance; - -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; - -import com.firebase.ui.auth.AuthUI; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.google.android.material.tabs.TabLayout; -import com.google.firebase.auth.FirebaseAuth; -import com.google.firebase.auth.FirebaseUser; -import com.google.firebase.database.DataSnapshot; -import com.google.firebase.database.DatabaseError; -import com.google.firebase.database.DatabaseReference; -import com.google.firebase.database.FirebaseDatabase; -import com.google.firebase.database.ValueEventListener; - -import java.util.Calendar; -import java.util.HashSet; -import java.util.Set; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; -import androidx.core.app.ActivityCompat; -import androidx.core.content.ContextCompat; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentPagerAdapter; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.PagerAdapter; -import androidx.viewpager.widget.ViewPager; -import io.github.zkhan93.familyfinance.models.Member; -import io.github.zkhan93.familyfinance.util.Util; - -import static io.github.zkhan93.familyfinance.FragmentMembers.PERMISSION_REQUEST_CODE; - -public class MainActivity extends AppCompatActivity{ - - public static final String TAG = MainActivity.class.getSimpleName(); - public String familyId; - public int PIN_CHECK_REQUEST_CODE = 435; - /** - * The {@link ViewPager} that will host the section contents. - */ - ViewPager mViewPager; - FloatingActionButton fab; - @Nullable - TabLayout tabLayout; - - /** - * The {@link PagerAdapter} that will provide - * fragments for each of the sections. We use a - * {@link FragmentPagerAdapter} derivative, which will keep every - * loaded fragment in memory. If this becomes too memory intensive, it - * may be best to switch to a - * {@link FragmentStatePagerAdapter}. - */ - - private ViewPager.OnPageChangeListener pageChangeListener; - private int activePage; - private String familyModeratorId; - private Member me; - private ValueEventListener keywordsListener, otpCharsListener, otpLengthListener; - private int compilePatternAfterNoOfCallback; - private SharedPreferences sharedPreferences; - private View.OnClickListener clickListener; - { - activePage = PAGE_POSITION.SUMMARY; - pageChangeListener = new ViewPager - .OnPageChangeListener() { - @Override - public void onPageScrolled(int position, float positionOffset, int - positionOffsetPixels) { - - } - - @Override - public void onPageSelected(int position) { - activePage = position; - switch (position) { - case PAGE_POSITION.SUMMARY: - hideFab(); - break; - case PAGE_POSITION.ACCOUNTS: - showFab(); - break; - case PAGE_POSITION.CCARDS: - showFab(); - break; - case PAGE_POSITION.SMS: - hideFab(); - break; - case PAGE_POSITION.MEMBERS: - if (familyModeratorId != null && me != null && me.getId() != null && - familyModeratorId.equals(me.getId())) - showFab(); - else hideFab(); - break; -// case PAGE_POSITION.EMAILS: -// hideFab(); -// case PAGE_POSITION.CHAT_ROOM: -// hideFab(); -// break; - case PAGE_POSITION.CREDENTIALS: - showFab(); - break; - case PAGE_POSITION.DCARDS: - showFab(); - break; -// case PAGE_POSITION.WALLETS: -// showFab(); -// break; - } - } - - @Override - public void onPageScrollStateChanged(int state) { - - } - }; - otpCharsListener = new ValueEventListener() { - @Override - public void onDataChange(DataSnapshot dataSnapshot) { - if (dataSnapshot == null || dataSnapshot.getChildrenCount() == 0) return; - StringBuilder otpChars = new StringBuilder(); - String otpChar; - for (DataSnapshot ds : dataSnapshot.getChildren()) { - otpChar = ds.getValue(String.class); - if (otpChar == null) continue; - otpChars.append(otpChar); - } - sharedPreferences.edit().putString("otpChars", otpChars.toString()).apply(); - } - - @Override - public void onCancelled(DatabaseError databaseError) { - Log.d(TAG, "onCancelled: " + databaseError.getMessage()); - } - }; - keywordsListener = new ValueEventListener() { - @Override - public void onDataChange(DataSnapshot dataSnapshot) { - if (dataSnapshot == null || dataSnapshot.getChildrenCount() == 0) return; - Set keywords = new HashSet<>(); - String keyword; - for (DataSnapshot ds : dataSnapshot.getChildren()) { - keyword = ds.getValue(String.class); - if (keyword == null) continue; - keywords.add(keyword); - } - sharedPreferences.edit().putStringSet("keywords", keywords).apply(); - compilePatternAfterNoOfCallback -= 1; - tryCompilePattern(); - } - - @Override - public void onCancelled(DatabaseError databaseError) { - - } - }; - otpLengthListener = new ValueEventListener() { - @Override - public void onDataChange(DataSnapshot dataSnapshot) { - if (dataSnapshot == null || dataSnapshot.getChildrenCount() == 0) return; - StringBuilder lengths = new StringBuilder(); - Long length; - for (DataSnapshot ds : dataSnapshot.getChildren()) { - length = ds.getValue(Long.class); - if (length == null) continue; - lengths.append(length); - lengths.append(","); - } - if (lengths.length() > 0) - lengths.deleteCharAt(lengths.length() - 1); - sharedPreferences.edit().putString("otpLengths", lengths.toString()).apply(); - compilePatternAfterNoOfCallback -= 1; - tryCompilePattern(); - } - - @Override - public void onCancelled(DatabaseError databaseError) { - - } - }; - - } - - public MainActivity() { - clickListener = view -> { - switch (view.getId()) { - case R.id.fab: - String message; - switch (activePage) { - case PAGE_POSITION.ACCOUNTS: - DialogFragmentAddAccount.newInstance(familyId).show - (getSupportFragmentManager(), - DialogFragmentAddAccount.TAG); - break; - case PAGE_POSITION.CCARDS: - DialogFragmentCcard.newInstance(familyId).show(getSupportFragmentManager - (), DialogFragmentCcard.TAG); - break; - case PAGE_POSITION.DCARDS: - DialogFragmentDcard.newInstance(familyId).show(getSupportFragmentManager - (), DialogFragmentCcard.TAG); - break; -// case PAGE_POSITION.WALLETS: -// DialogFragmentDcard.newInstance(familyId).show(getSupportFragmentManager -// (), DialogFragmentCcard.TAG); -// break; - case PAGE_POSITION.MEMBERS: - Intent intent = new Intent(getApplicationContext(), AddMemberActivity.class); - intent.putExtra(getString(R.string.pref_family_id), familyId); - startActivity(intent); - break; - case PAGE_POSITION.CREDENTIALS: - DialogFragmentCredential.getInstance(null, familyId) - .show(getSupportFragmentManager(), DialogFragmentViewCard.TAG); - default: - break; - } - - break; - default: - Log.d(TAG, "action not implemented"); - } - }; - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - mViewPager = findViewById(R.id.container); - fab = findViewById(R.id.fab); - tabLayout = findViewById(R.id.tabs); - fab.setOnClickListener(clickListener); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - // Create the adapter that will return a fragment for each of the three - // primary sections of the activity. - SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter - (getSupportFragmentManager()); - // Set up the ViewPager with the sections adapter. - hideFab(); - mViewPager.setAdapter(mSectionsPagerAdapter); - mViewPager.addOnPageChangeListener(pageChangeListener); - if (tabLayout != null) - tabLayout.setupWithViewPager(mViewPager); - Intent intent = getIntent(); - if (intent != null) { - int currentFragment = intent.getIntExtra("FragmentPosition", 0); - mViewPager.setCurrentItem(currentFragment); - } - } - - @Override - protected void onResume() { - super.onResume(); - if (needsPinVerification()) { - startActivityForResult(new Intent(PinActivity.ACTIONS.CHECK_PIN, null, this, PinActivity - .class), PIN_CHECK_REQUEST_CODE); - } - } - - @Override - protected void onStart() { - super.onStart(); - sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - familyId = sharedPreferences.getString(getString(R.string.pref_family_id), null); - DatabaseReference ref = FirebaseDatabase.getInstance().getReference(); - compilePatternAfterNoOfCallback = 2; - //TODO: download the a json from https://gist.githubusercontent.com/zkhan93/500fc1fbcbd00724f8e856c6d0dac702/raw/card_brands.json as save it in preference as a string - ref.child("otpChars").addListenerForSingleValueEvent - (otpCharsListener); - ref.child("otpLength").addListenerForSingleValueEvent - (otpLengthListener); - ref.child("keywords").addListenerForSingleValueEvent - (keywordsListener); - ref.child("family").child(familyId).child("moderator") - .child("id").addListenerForSingleValueEvent(new ValueEventListener() { - - @Override - public void onDataChange(DataSnapshot dataSnapshot) { - if (dataSnapshot == null) return; - familyModeratorId = dataSnapshot.getValue(String.class); - if (familyModeratorId == null) return; - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit() - .putString("familyModeratorId", familyModeratorId).apply(); - } - - @Override - public void onCancelled(DatabaseError databaseError) { - - } - }); - FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); - if (familyId == null || user == null) { - startActivity(new Intent(this, SelectFamilyActivity.class)); - finish(); - return; - } - String photoUrl = null; - if (user.getPhotoUrl() != null) - photoUrl = user.getPhotoUrl().toString(); - me = ((App) getApplication()).getDaoSession().getMemberDao().load(user.getUid()); - if (me == null) { - me = new Member(user.getUid(), - user.getDisplayName(), - user.getEmail(), - Calendar.getInstance().getTimeInMillis(), - false, - photoUrl); - ((App) getApplication()).getDaoSession().getMemberDao().insertOrReplace(me); - } - int permissionCheck = ContextCompat.checkSelfPermission(this, android.Manifest - .permission.RECEIVE_SMS) & ContextCompat.checkSelfPermission(this, android.Manifest - .permission.READ_PHONE_STATE); - - if (permissionCheck != PackageManager.PERMISSION_GRANTED) { - if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest - .permission.RECEIVE_SMS)) { - //explain the need of this permission - //todo show a dialog and then on positive show request permission - Log.d(TAG, "lol we need it :D"); - ActivityCompat.requestPermissions(this, new String[]{ - android.Manifest.permission.RECEIVE_SMS, android.Manifest.permission - .READ_PHONE_STATE - }, PERMISSION_REQUEST_CODE); - - } else { - ActivityCompat.requestPermissions(this, new String[]{ - android.Manifest.permission.RECEIVE_SMS, android.Manifest.permission - .READ_PHONE_STATE - }, PERMISSION_REQUEST_CODE); - } - } - } - - @Override - protected void onPause() { - super.onPause(); - if (verified) { - - PreferenceManager.getDefaultSharedPreferences(this).edit().putLong("lastActive", - Calendar - .getInstance().getTimeInMillis()).apply(); - verified = !verified; - } - } - - private boolean needsPinVerification() { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); - Long lastActive = sharedPreferences.getLong("lastActive", -1); - boolean pinEnabled = sharedPreferences.getBoolean(getString(R.string.pref_key_pin), false); - //default 10 sec min in setting - long seconds = 10; - try { - String tmp = sharedPreferences.getString(getString(R.string.pref_key_autolock), "10"); - seconds = Integer.parseInt(tmp); - - } catch (ClassCastException ex) { - Log.e(TAG, "cannot cast seconds: " + sharedPreferences.getString - (getString(R.string.pref_key_autolock), "")); - } - return pinEnabled && - (lastActive == -1 || lastActive < Calendar.getInstance().getTimeInMillis() - - seconds * 1000); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, 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 - switch (id) { - case R.id.action_settings: - startActivity(new Intent(MainActivity.this, SettingsActivity.class)); - return true; - case R.id.action_logout: - AuthUI.getInstance() - .signOut(this) - .addOnCompleteListener(new OnCompleteListener() { - public void onComplete(@NonNull Task task) { - // user is now signed out - startActivity(new Intent(MainActivity.this, LoginActivity.class)); - finish(); - } - }); - return true; - case R.id.action_switch_family: - PreferenceManager.getDefaultSharedPreferences(this).edit().remove - (getString(R.string.pref_family_id)).apply(); - startActivity(new Intent(this, SelectFamilyActivity.class)); - finish(); - return true; - case R.id.action_about: - startActivity(new Intent(MainActivity.this, AboutActivity.class)); - return true; - } - return super.onOptionsItemSelected(item); - } - - public void showFab() { - if (fab != null) - fab.show(); - } - - public void hideFab() { - if (fab != null) - fab.hide(); - } - - /** - * A {@link FragmentPagerAdapter} that returns a fragment corresponding to - * one of the sections/tabs/pages. - */ - public class SectionsPagerAdapter extends FragmentPagerAdapter { - - public SectionsPagerAdapter(FragmentManager fm) { - super(fm); - } - - @Override - public Fragment getItem(int position) { - // getItem is called to instantiate the fragment for the given page. - // Return a PlaceholderFragment (defined as a static inner class below). - Fragment fragment; - switch (position) { - case PAGE_POSITION.ACCOUNTS: - fragment = FragmentAccounts.newInstance(familyId); - break; - case PAGE_POSITION.CCARDS: - fragment = FragmentCCards.newInstance(familyId); - break; - case PAGE_POSITION.SMS: - fragment = FragmentSms.newInstance(familyId); - break; -// case PAGE_POSITION.EMAILS: -// fragment = FragmentEmails.newInstance(familyId); -// break; - case PAGE_POSITION.MEMBERS: - fragment = FragmentMembers.newInstance(familyId, familyModeratorId); - break; -// case PAGE_POSITION.CHAT_ROOM: -// fragment = FragmentChatroom.newInstance(familyId); -// break; - case PAGE_POSITION.CREDENTIALS: - fragment = FragmentCredentials.newInstance(familyId); - break; - case PAGE_POSITION.DCARDS: - fragment = FragmentDCards.newInstance(familyId); - break; -// case PAGE_POSITION.WALLETS: -// fragment = FragmentWallets.newInstance(familyId); -// break; - default: //0 or other - fragment = FragmentSummary.newInstance(familyId); - break; - } - return fragment; - } - - @Override - public int getCount() { - return PAGE_POSITION.class.getFields().length; - } - - @Override - public CharSequence getPageTitle(int position) { - switch (position) { - case PAGE_POSITION.SUMMARY: - return getString(R.string.title_summary); - case PAGE_POSITION.ACCOUNTS: - return getString(R.string.title_accounts); - case PAGE_POSITION.CCARDS: - return getString(R.string.title_ccards); - case PAGE_POSITION.SMS: - return getString(R.string.title_sms); - case PAGE_POSITION.MEMBERS: - return getString(R.string.title_members); -// case PAGE_POSITION.EMAILS: -// return getString(R.string.title_emails); -// case PAGE_POSITION.CHAT_ROOM: -// return getString(R.string.title_chat_room); - case PAGE_POSITION.CREDENTIALS: - return getString(R.string.title_credentials); - case PAGE_POSITION.DCARDS: - return getString(R.string.title_dcards); -// case PAGE_POSITION.WALLETS: -// return getString(R.string.title_wallets); - } - return null; - } - - - } - - public interface PAGE_POSITION { - int SUMMARY = 0; - int CCARDS = 1; - int SMS = 2; - int DCARDS = 3; - // int WALLETS = 4; - int CREDENTIALS = 4; - int ACCOUNTS = 5; - // int EMAILS = 7; - int MEMBERS = 6; -// int CHAT_ROOM = 9; - } - - private boolean verified = false; - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == PIN_CHECK_REQUEST_CODE) { - if (resultCode == RESULT_OK) { - verified = true; - PreferenceManager.getDefaultSharedPreferences(this).edit().putLong("lastActive", - Calendar - .getInstance().getTimeInMillis()).apply(); - } else { - finish(); - } - return; - } - super.onActivityResult(requestCode, resultCode, data); - } - - private void tryCompilePattern() { - if (compilePatternAfterNoOfCallback == 0) { - Util.readOtpRegexValuesAndCompilePattern(getApplicationContext()); - } - } -} diff --git a/app/src/main/java/io/github/zkhan93/familyfinance/services/MessagingService.java b/app/src/main/java/io/github/zkhan93/familyfinance/services/MessagingService.java index 91b02d0..dd541d1 100644 --- a/app/src/main/java/io/github/zkhan93/familyfinance/services/MessagingService.java +++ b/app/src/main/java/io/github/zkhan93/familyfinance/services/MessagingService.java @@ -28,7 +28,7 @@ import androidx.core.app.NotificationCompat; import io.github.zkhan93.familyfinance.App; -import io.github.zkhan93.familyfinance.MainActivity; +import io.github.zkhan93.familyfinance.HomeActivity; import io.github.zkhan93.familyfinance.R; import io.github.zkhan93.familyfinance.models.Member; import io.github.zkhan93.familyfinance.util.Util; @@ -122,8 +122,9 @@ public static String showNotification(Context context, Map data) .pref_key_vibrate), false); Log.d(TAG, "vibration setting: " + vibrate); - Intent resultIntent = new Intent(context, MainActivity.class); - resultIntent.putExtra("FragmentPosition", MainActivity.PAGE_POSITION.SMS); + Intent resultIntent = new Intent(context, HomeActivity.class); +// MainActivity.PAGE_POSITION.SMS + resultIntent.putExtra("FragmentPosition", 2); PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); diff --git a/app/src/main/java/io/github/zkhan93/familyfinance/vm/AppState.java b/app/src/main/java/io/github/zkhan93/familyfinance/vm/AppState.java index cebc916..884b34d 100644 --- a/app/src/main/java/io/github/zkhan93/familyfinance/vm/AppState.java +++ b/app/src/main/java/io/github/zkhan93/familyfinance/vm/AppState.java @@ -37,4 +37,13 @@ public MutableLiveData getFabShow() { public void setFabShow(boolean show) { fabShow.setValue(show); } + + public void enableFab(@DrawableRes int icon, String id){ + setFabShow(true); + fabActionId.setValue(id); + } + public void disableFab(){ + setFabShow(false); + fabActionId.setValue(null); + } } diff --git a/app/src/main/res/anim/slide_in_up.xml b/app/src/main/res/anim/slide_in_up.xml deleted file mode 100644 index a8c3d2a..0000000 --- a/app/src/main/res/anim/slide_in_up.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/anim/slide_out_up.xml b/app/src/main/res/anim/slide_out_up.xml deleted file mode 100644 index 2815a6c..0000000 --- a/app/src/main/res/anim/slide_out_up.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ccard_bg_black_gradient_no_round_corners.xml b/app/src/main/res/drawable/ccard_bg_black_gradient_no_round_corners.xml deleted file mode 100644 index 7b2b739..0000000 --- a/app/src/main/res/drawable/ccard_bg_black_gradient_no_round_corners.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ccard_bg_red_gradient.xml b/app/src/main/res/drawable/ccard_bg_red_gradient.xml deleted file mode 100644 index 20bdb0d..0000000 --- a/app/src/main/res/drawable/ccard_bg_red_gradient.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_account_box.xml b/app/src/main/res/drawable/ic_account_box.xml deleted file mode 100644 index d186182..0000000 --- a/app/src/main/res/drawable/ic_account_box.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_android_teal_500_48dp.xml b/app/src/main/res/drawable/ic_android_teal_500_48dp.xml deleted file mode 100644 index 66f0ac1..0000000 --- a/app/src/main/res/drawable/ic_android_teal_500_48dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_backspace_grey_600_24dp.xml b/app/src/main/res/drawable/ic_backspace_grey_600_24dp.xml deleted file mode 100644 index d42b18b..0000000 --- a/app/src/main/res/drawable/ic_backspace_grey_600_24dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_bank.xml b/app/src/main/res/drawable/ic_bank.xml deleted file mode 100644 index 8db0cbd..0000000 --- a/app/src/main/res/drawable/ic_bank.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_bg_login_top_simple.xml b/app/src/main/res/drawable/ic_bg_login_top_simple.xml deleted file mode 100644 index 498d7cc..0000000 --- a/app/src/main/res/drawable/ic_bg_login_top_simple.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_block_red_500_18dp.xml b/app/src/main/res/drawable/ic_block_red_500_18dp.xml deleted file mode 100644 index 8df0db0..0000000 --- a/app/src/main/res/drawable/ic_block_red_500_18dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_check_all_grey_500_18dp.xml b/app/src/main/res/drawable/ic_check_all_grey_500_18dp.xml deleted file mode 100644 index 2854e59..0000000 --- a/app/src/main/res/drawable/ic_check_all_grey_500_18dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_check_green_500_18dp.xml b/app/src/main/res/drawable/ic_check_green_500_18dp.xml deleted file mode 100644 index ffed29c..0000000 --- a/app/src/main/res/drawable/ic_check_green_500_18dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_check_grey_500_18dp.xml b/app/src/main/res/drawable/ic_check_grey_500_18dp.xml deleted file mode 100644 index 40baafd..0000000 --- a/app/src/main/res/drawable/ic_check_grey_500_18dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_check_grey_600_36dp.xml b/app/src/main/res/drawable/ic_check_grey_600_36dp.xml deleted file mode 100644 index 06b97e0..0000000 --- a/app/src/main/res/drawable/ic_check_grey_600_36dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_close_red_500_24dp.xml b/app/src/main/res/drawable/ic_close_red_500_24dp.xml deleted file mode 100644 index 1b24006..0000000 --- a/app/src/main/res/drawable/ic_close_red_500_24dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_credit_card.xml b/app/src/main/res/drawable/ic_credit_card.xml deleted file mode 100644 index 289f572..0000000 --- a/app/src/main/res/drawable/ic_credit_card.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_edit_black_24dp.xml b/app/src/main/res/drawable/ic_edit_black_24dp.xml deleted file mode 100644 index 5988478..0000000 --- a/app/src/main/res/drawable/ic_edit_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_hourglass_empty.xml b/app/src/main/res/drawable/ic_hourglass_empty.xml deleted file mode 100644 index 2d4f436..0000000 --- a/app/src/main/res/drawable/ic_hourglass_empty.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_info_black_24dp.xml b/app/src/main/res/drawable/ic_info_black_24dp.xml deleted file mode 100644 index d9c3703..0000000 --- a/app/src/main/res/drawable/ic_info_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml deleted file mode 100644 index 5ee298d..0000000 --- a/app/src/main/res/drawable/ic_notifications_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_share_grey_700_24dp.xml b/app/src/main/res/drawable/ic_share_grey_700_24dp.xml deleted file mode 100644 index 53e736a..0000000 --- a/app/src/main/res/drawable/ic_share_grey_700_24dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_sms_grey_500_24dp.xml b/app/src/main/res/drawable/ic_sms_grey_500_24dp.xml deleted file mode 100644 index aafd2d0..0000000 --- a/app/src/main/res/drawable/ic_sms_grey_500_24dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_sms_teal_500_24dp.xml b/app/src/main/res/drawable/ic_sms_teal_500_24dp.xml deleted file mode 100644 index 1ee830d..0000000 --- a/app/src/main/res/drawable/ic_sms_teal_500_24dp.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_sync_black_24dp.xml b/app/src/main/res/drawable/ic_sync_black_24dp.xml deleted file mode 100644 index 87603a5..0000000 --- a/app/src/main/res/drawable/ic_sync_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/line_grey_400.xml b/app/src/main/res/drawable/line_grey_400.xml deleted file mode 100644 index ef8047a..0000000 --- a/app/src/main/res/drawable/line_grey_400.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/login_btn_bg.xml b/app/src/main/res/drawable/login_btn_bg.xml deleted file mode 100644 index 6d52a6d..0000000 --- a/app/src/main/res/drawable/login_btn_bg.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/login_btn_bg_selector.xml b/app/src/main/res/drawable/login_btn_bg_selector.xml deleted file mode 100644 index 0283e83..0000000 --- a/app/src/main/res/drawable/login_btn_bg_selector.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/visa.png b/app/src/main/res/drawable/visa.png deleted file mode 100644 index 5bc6343..0000000 Binary files a/app/src/main/res/drawable/visa.png and /dev/null differ diff --git a/app/src/main/res/layout/activity_card_detail.xml b/app/src/main/res/layout/activity_card_detail.xml deleted file mode 100644 index 0100f07..0000000 --- a/app/src/main/res/layout/activity_card_detail.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 329eedc..ecee0b0 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,7 +6,7 @@ android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="io.github.zkhan93.familyfinance.MainActivity"> + tools:context="io.github.zkhan93.familyfinance.HomeActivity"> + tools:context="io.github.zkhan93.familyfinance.HomeActivity"> - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/listitem_addon_card.xml b/app/src/main/res/layout/listitem_addon_card.xml deleted file mode 100644 index 351cc01..0000000 --- a/app/src/main/res/layout/listitem_addon_card.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/listitem_dcard.xml b/app/src/main/res/layout/listitem_dcard.xml deleted file mode 100644 index 64afc1a..0000000 --- a/app/src/main/res/layout/listitem_dcard.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/listitem_wallet.xml b/app/src/main/res/layout/listitem_wallet.xml deleted file mode 100644 index c71e80b..0000000 --- a/app/src/main/res/layout/listitem_wallet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/ccard_item.xml b/app/src/main/res/menu/ccard_item.xml deleted file mode 100644 index 8fcaa8b..0000000 --- a/app/src/main/res/menu/ccard_item.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/dcard_item.xml b/app/src/main/res/menu/dcard_item.xml deleted file mode 100644 index 571890a..0000000 --- a/app/src/main/res/menu/dcard_item.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/fragment_cards.xml b/app/src/main/res/menu/fragment_cards.xml index 96c2fdb..0dd5501 100644 --- a/app/src/main/res/menu/fragment_cards.xml +++ b/app/src/main/res/menu/fragment_cards.xml @@ -1,7 +1,7 @@ + tools:context="io.github.zkhan93.familyfinance.HomeActivity"> + tools:context="io.github.zkhan93.familyfinance.HomeActivity"> - #00000000 @color/md_grey_100 @color/md_grey_900 @color/md_grey_600 @@ -8,302 +7,78 @@ #344955 #344955 - #4A6572 - #f9AA33 #f9AA33 - #f9AA33 #212121 - #757575 #f36c60 - #66000000 - #fde0dc - #f9bdbb - #f69988 #f36c60 #e84e40 #e51c23 #dd191d - #d01716 - #c41411 - #b0120a - #ff7997 - #ff5177 - #ff2d6f - #e00032 - #fce4ec - #f8bbd0 - #f48fb1 - #f06292 - #ec407a - #e91e63 - #d81b60 - #c2185b - #ad1457 - #880e4f - #ff80ab - #ff4081 - #f50057 - #c51162 - #f3e5f5 - #e1bee7 - #ce93d8 - #ba68c8 - #ab47bc - #9c27b0 - #8e24aa - #7b1fa2 - #6a1b9a - #4a148c - #ea80fc - #e040fb - #d500f9 - #aa00ff - #ede7f6 - #d1c4e9 - #b39ddb - #9575cd - #7e57c2 - #673ab7 - #5e35b1 - #512da8 - #4527a0 - #311b92 - #b388ff - #7c4dff - #651fff - #6200ea - #e8eaf6 - #c5cae9 - #9fa8da - #7986cb - #5c6bc0 - #3f51b5 - #3949ab - #303f9f - #283593 - #1a237e - #8c9eff - #536dfe - #3d5afe - #304ffe - #e7e9fd - #d0d9ff - #afbfff - #91a7ff - #738ffe - #5677fc - #4e6cef - #455ede - #3b50ce - #2a36b1 - #a6baff - #6889ff - #4d73ff - #4d69ff - #e1f5fe - #b3e5fc - #81d4fa - #4fc3f7 - #29b6f6 - #03a9f4 - #039be5 - #0288d1 - #0277bd - #01579b - #80d8ff - #40c4ff - #00b0ff - #0091ea - #e0f7fa - #b2ebf2 - #80deea - #4dd0e1 - #26c6da - #00bcd4 - #00acc1 - #0097a7 - #00838f - #006064 - #84ffff - #18ffff - #00e5ff - #00b8d4 - #e0f2f1 - #b2dfdb - #80cbc4 #4db6ac - #26a69a - #009688 - #00897b - #00796b - #00695c - #004d40 - #a7ffeb - #64ffda - #1de9b6 #00bfa5 - #d0f8ce - #a3e9a4 - #72d572 #42bd41 #2baf2b #259b24 - #0a8f08 - #0a7e07 - #056f00 - #0d5302 - #a2f78d - #5af158 - #14e715 - #12c700 - #f1f8e9 - #dcedc8 #c5e1a5 - #aed581 - #9ccc65 - #8bc34a - #7cb342 - #689f38 - #558b2f - #33691e - #ccff90 - #b2ff59 - #76ff03 - #64dd17 - #f9fbe7 - #f0f4c3 - #e6ee9c - #dce775 - #d4e157 - #cddc39 - #c0ca33 - #afb42b - #9e9d24 - #827717 - #f4ff81 - #eeff41 - #c6ff00 - #aeea00 - #fffde7 - #fff9c4 - #fff59d - #fff176 - #ffee58 - #ffeb3b - #fdd835 - #fbc02d - #f9a825 - #f57f17 - #ffff8d - #ffff00 - #ffea00 - #ffd600 - #fff8e1 - #ffecb3 - #ffe082 - #ffd54f - #ffca28 - #ffc107 - #ffb300 - #ffa000 #ff8f00 - #ff6f00 - #ffe57f - #ffd740 - #ffc400 - #ffab00 - #fff3e0 - #ffe0b2 - #ffcc80 - #ffb74d #ffa726 #ff9800 - #fb8c00 #f57c00 #ef6c00 - #e65100 - #ffd180 - #ffab40 - #ff9100 - #ff6d00 - #fbe9e7 - #ffccbc - #ffab91 - #ff8a65 - #ff7043 - #ff5722 - #f4511e - #e64a19 - #d84315 - #bf360c - #ff9e80 - #ff6e40 - #ff3d00 - #dd2c00 - #efebe9 - #d7ccc8 - #bcaaa4 - #a1887f - #8d6e63 - #795548 - #6d4c41 - #5d4037 - #4e342e - #3e2723 @@ -311,27 +86,15 @@ #f5f5f5 #eeeeee #e0e0e0 - #bdbdbd #9e9e9e #757575 - #616161 - #424242 #212121 #000000 #ffffff - #eceff1 - #cfd8dc - #b0bec5 - #90a4ae - #78909c - #607d8b - #546e7a - #455a64 #37474f #263238 - #66000000 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 3f4277b..04394c9 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,11 +1,9 @@ 16dp - 16dp 16dp - 8dp - + 10sp 15sp 20sp @@ -13,7 +11,6 @@ - 4dp 8dp 16dp 24dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c010449..3e9c21a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,50 +2,40 @@ Family Finance - Sign in Home Summary - Emails Accounts Members SMS Messages Credit Cards Debit Cards - Wallets Settings Add Account Add Card Family Requests @string/app_name - Chat Room Show SMS only from Billing Cycle Credentials Create Credentials - Update Credentials Settings Sign out Filter SMS - Copy to clipboard Edit - Update Share Delete - Add Addon Card - Remove Switch Family About - Account\'s Name Account holder\'s name Account Number @@ -55,14 +45,11 @@ Max Limit Consumed - Name User ID PIN Password Bank Name Branch IFSC Code - Balance - Family ID Phone Number Email Username @@ -70,9 +57,7 @@ Unique Family ID - Logging you in.. Select an account.. - Login attempt cancelled Please check your internet connection and try again Invalid response from server, Please try again Sign in failed, Please try again @@ -84,7 +69,6 @@ Family with this ID does not exist! click "Create New Family" to start a new family with this ID Please login to continue Previous task was not given - You are not a member in this family Your request to join the family has been sent to the moderator of the family Your request is approved @@ -94,21 +78,14 @@ - \u20B9 Show more Show less clear - Add Allow read emails Allow us to read your email and show it to everyone in this family. Create Update - Join Online - Send Request - Your Request - OR - Start New Family %1$s copied Oops! cannot find OTP %1$s cannot copy to clipboard @@ -118,7 +95,6 @@ CVV Next Bill Card Limit - Add-on Cards Card Type Card Information Transaction History @@ -128,8 +104,6 @@ Edit - Primary Card - Add-on Card General @@ -139,13 +113,10 @@ Notification Only OTP SMS Auto Copy - Ringtone Vibrate - Vibrate Duration Secure PIN Auto-Lock SMS Sync - Number of SMS Incoming OTP will get copied to your clipboard automatically Do not copy incoming OTP automatically to clipboard @@ -163,14 +134,12 @@ pref_key_notification pref_key_notification_only_otp pref_key_vibrate - pref_key_vibrate_duration pref_key_ringtone pref_key_copy pref_key_pin pref_key_pin_value pref_key_autolock pref_key_allsms - pref_key_no_of_sms familyId @@ -188,7 +157,6 @@ Version Info - Hello blank fragment 10 60 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4929921..9634ce5 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -77,20 +77,10 @@ - - - -