Skip to content

Commit

Permalink
fix openMF#985:Enhanced create entity fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshGautam committed May 23, 2018
1 parent 6f677a1 commit bc78d75
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 132 deletions.
1 change: 1 addition & 0 deletions mifosng-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ android {
versionName "1.0.1"
// A test runner provided by https://code.google.com/p/android-test-kit/
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public class CreateNewCenterFragment extends MifosBaseFragment
@BindView(R.id.ll_center)
LinearLayout llCenter;

@BindView(R.id.layout_submission)
LinearLayout layout_submission;

int officeId;
Boolean result = true;
@Inject
Expand Down Expand Up @@ -114,9 +117,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (isChecked) {
tv_activationDate.setVisibility(View.VISIBLE);
layout_submission.setVisibility(View.VISIBLE);
} else {
tv_activationDate.setVisibility(View.GONE);
layout_submission.setVisibility(View.GONE);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -97,6 +98,9 @@ public class CreateNewClientFragment extends ProgressableFragment
@BindView(R.id.sp_client_classification)
Spinner spClientClassification;

@BindView(R.id.layout_submission)
LinearLayout layout_submission;

@Inject
CreateNewClientPresenter createNewClientPresenter;

Expand Down Expand Up @@ -292,7 +296,7 @@ public void onClickSubmitButton() {

@OnCheckedChanged(R.id.cb_client_active_status)
public void onClickActiveCheckBox() {
tvSubmissionDate.setVisibility(cbClientActiveStatus.isChecked()
layout_submission.setVisibility(cbClientActiveStatus.isChecked()
? View.VISIBLE : View.GONE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -85,6 +86,9 @@ public class CreateNewGroupFragment extends ProgressableFragment
@BindView(R.id.btn_submit)
Button bt_submit;

@BindView(R.id.layout_submission)
LinearLayout layout_submission;

@Inject
CreateNewGroupPresenter mCreateNewGroupPresenter;

Expand Down Expand Up @@ -147,9 +151,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (isChecked) {
tv_activationDate.setVisibility(View.VISIBLE);
layout_submission.setVisibility(View.VISIBLE);
} else {
tv_activationDate.setVisibility(View.GONE);
layout_submission.setVisibility(View.GONE);
}

}
Expand Down
9 changes: 9 additions & 0 deletions mifosng-android/src/main/res/drawable/ic_event_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M17,12h-5v5h5v-5zM16,1v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2h-1L18,1h-2zM19,19L5,19L5,8h14v11z"/>
</vector>
80 changes: 62 additions & 18 deletions mifosng-android/src/main/res/layout/fragment_create_new_center.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_height="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_center"
Expand All @@ -19,23 +19,28 @@
android:singleLine="true"/>
<requestFocus />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_office"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:text="@string/office_name_mandatory"
android:textSize="16sp"

android:textSize="12sp"
style="@style/Base.TextAppearance.AppCompat.Small"
/>

<Spinner
<android.support.v7.widget.AppCompatSpinner
style="@style/Widget.AppCompat.Spinner.Underlined"
android:id="@+id/sp_center_offices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:spinnerMode="dropdown"
android:background="@color/light_grey"/>
android:paddingTop="10dp"
android:backgroundTint="@color/gray_dark"/>
</LinearLayout>
<android.support.design.widget.TextInputLayout style="@style/TextInput.Base">
</android.support.design.widget.TextInputLayout>
<CheckBox
Expand All @@ -48,17 +53,56 @@
android:text="@string/center_active"
/>

<TextView
android:id="@+id/tv_center_activationDate"
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="date"
android:paddingBottom="10dp"
android:textSize="20sp"
android:text="@string/center_activation_date"
android:orientation="vertical"
android:paddingTop="16dp"
android:visibility="gone"
android:id="@+id/layout_submission">

/>
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal">

<ImageView
android:baselineAlignBottom="true"
android:layout_gravity="center"
android:layout_height="30dp"
android:layout_marginTop="4dp"
android:layout_width="30dp"
app:srcCompat="@drawable/ic_event_black_24dp"/>

<LinearLayout
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="match_parent"
android:orientation="vertical">

<TextView
style="@style/Base.TextAppearance.AppCompat.Small"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:textSize="12sp"
android:text="@string/loan_submission_date"/>

<TextView
android:id="@+id/tv_center_activationDate"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />

</LinearLayout>

</LinearLayout>
<View
android:background="@color/gray_dark"
android:layout_height="0.2dp"
android:layout_marginTop="8dp"
android:layout_width="match_parent"/>

</LinearLayout>


<Button
Expand Down
Loading

0 comments on commit bc78d75

Please sign in to comment.