AccountsFragment now opens GeneralSettings and minor fixes

This commit is contained in:
Severiano Jaramillo 2017-12-28 13:23:25 -06:00
parent 246234a165
commit b59e17175a
2 changed files with 21 additions and 9 deletions

View file

@ -1,6 +1,7 @@
package cy.agorise.crystalwallet.fragments; package cy.agorise.crystalwallet.fragments;
import android.app.Dialog; import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
@ -10,15 +11,21 @@ import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.activities.GeneralSettingsActivity;
public class AccountsFragment extends DialogFragment { public class AccountsFragment extends DialogFragment {
@BindView(R.id.tvGeneralSettings)
TextView tvGeneralSettings;
@BindView(R.id.tvClose) @BindView(R.id.tvClose)
TextView tvClose; TextView tvClose;
@ -51,11 +58,7 @@ public class AccountsFragment extends DialogFragment {
View view = inflater.inflate(R.layout.fragment_accounts, null); View view = inflater.inflate(R.layout.fragment_accounts, null);
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
builder.setView(view); return builder.setView(view).create();
Dialog dialog = builder.create();
return dialog;
} }
@Override @Override
@ -63,7 +66,16 @@ public class AccountsFragment extends DialogFragment {
super.onResume(); super.onResume();
// Force dialog fragment to use the full width of the screen // Force dialog fragment to use the full width of the screen
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@OnClick(R.id.tvGeneralSettings)
public void onBtnGeneralSettingsClick(){
dismiss();
Intent intent = new Intent(getActivity(), GeneralSettingsActivity.class);
startActivity(intent);
} }
@OnClick(R.id.tvClose) @OnClick(R.id.tvClose)

View file

@ -110,7 +110,7 @@
app:layout_constraintEnd_toEndOf="parent"/> app:layout_constraintEnd_toEndOf="parent"/>
<ImageView <ImageView
android:id="@+id/ivSettings" android:id="@+id/ivGeneralSettings"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
app:srcCompat="@drawable/ic_settings_24dp" app:srcCompat="@drawable/ic_settings_24dp"
@ -120,13 +120,13 @@
app:layout_constraintStart_toStartOf="@id/forthView"/> app:layout_constraintStart_toStartOf="@id/forthView"/>
<TextView <TextView
android:id="@+id/tvSettings" android:id="@+id/tvGeneralSettings"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings" android:text="@string/settings"
android:textStyle="bold" android:textStyle="bold"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
app:layout_constraintStart_toEndOf="@id/ivSettings" app:layout_constraintStart_toEndOf="@id/ivGeneralSettings"
app:layout_constraintTop_toTopOf="@id/forthView" app:layout_constraintTop_toTopOf="@id/forthView"
app:layout_constraintBottom_toBottomOf="@id/forthView"/> app:layout_constraintBottom_toBottomOf="@id/forthView"/>