Skip to content

Commit

Permalink
Normal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jainakshansh committed Feb 1, 2018
1 parent 5c9210b commit b8ce42b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 61 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/me/akshanshjain/manage/CardsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import javax.crypto.Cipher;
Expand All @@ -17,6 +18,8 @@
public class CardsActivity extends AppCompatActivity {

private Toolbar toolbar;
private ListView listView;
private View emptyView;
private TextView noCards;
private Button getStarted;

Expand Down Expand Up @@ -49,6 +52,8 @@ protected void onCreate(Bundle savedInstanceState) {
/*
Referencing views from the XML and styling them.
*/
listView = findViewById(R.id.list_view_cards);
emptyView = findViewById(R.id.empty_view_cards);
noCards = findViewById(R.id.no_cards_text);
getStarted = findViewById(R.id.get_started_cards);
noCards.setTypeface(quicksand_bold);
Expand All @@ -59,5 +64,8 @@ public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), NewCardActivity.class));
}
});

//Setting the empty view on the list when no items are present.
listView.setEmptyView(emptyView);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.widget.EditText;
import android.widget.TextView;

import java.security.KeyStore;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
Expand All @@ -27,6 +28,7 @@
import javax.crypto.KeyGenerator;

import me.akshanshjain.manage.Adapters.CategorySpinnerAdapter;
import me.akshanshjain.manage.Utils.Encryptor;

public class NewCardActivity extends AppCompatActivity {

Expand All @@ -45,8 +47,12 @@ public class NewCardActivity extends AppCompatActivity {

private Typeface quicksand_medium, quicksand_bold;

private KeyStore keyStore;
private KeyGenerator keyGenerator;
private KeyGenParameterSpec keyGenParameterSpec;
private Encryptor encryptor;

private static final String ALIAS = "AKSHANSH_MANAGE";

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -59,7 +65,7 @@ protected void onCreate(Bundle savedInstanceState) {
getSupportActionBar().setTitle("Add New Card");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

initViews();

dateLabelUpdate();
Expand Down
57 changes: 0 additions & 57 deletions app/src/main/java/me/akshanshjain/manage/Utils/Decryptor.java

This file was deleted.

6 changes: 3 additions & 3 deletions app/src/main/java/me/akshanshjain/manage/Utils/Encryptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
* Created by Akshansh on 31-01-2018.
*/

class Encryptor {
public class Encryptor {

private static final String TRANSFORMATION = "AES/GCM/NoPadding";
private static final String ANDROID_KEY_STORE = "AndroidKeyStore";

private byte[] encryption;
private byte[] iv;

Encryptor() {
public Encryptor() {
}

@RequiresApi(api = Build.VERSION_CODES.M)
byte[] encryptText(String alias, String textToEncrypt)
public byte[] encryptText(String alias, String textToEncrypt)
throws UnrecoverableEntryException, NoSuchAlgorithmException, KeyStoreException,
NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, IOException,
InvalidAlgorithmParameterException, SignatureException, BadPaddingException,
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/activity_cards.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@

</android.support.design.widget.AppBarLayout>

<ListView
android:id="@+id/list_view_cards"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:paddingBottom="64dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/app_bar_layout_cards" />

<LinearLayout
android:id="@+id/empty_view_cards"
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_transactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

</android.support.design.widget.AppBarLayout>


<ListView
android:id="@+id/list_view_transactions"
android:layout_width="match_parent"
Expand Down

0 comments on commit b8ce42b

Please sign in to comment.