Skip to content

Commit

Permalink
Merge pull request #32 from steve111MV/master
Browse files Browse the repository at this point in the history
1st release, Language(s): French.
  • Loading branch information
steve111MV authored Jul 2, 2020
2 parents 3ae35e9 + f5c9cb6 commit 6420881
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 328 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
**[GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html)**

## Contacts:
:email: [collectif.toa@gmail.com](mailto:collectif.toa@gmail.com)

:email: [collectif.toa@gmail.com](mailto:collectif.toa@gmail.com)
2 changes: 1 addition & 1 deletion app/src/main/java/org/changemakers/toa/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {

binding.collapsingToolabar.setTitleEnabled(false);
} else {
//binding.collapsingToolabar.setTitleEnabled(false);
//binding.appBar.collapsingToolabar.setTitleEnabled(false);

//IDDLE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
sDiagnosisOptions = getResources().getStringArray(R.array.diagnosis_options);

try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand Down Expand Up @@ -177,11 +177,11 @@ public void onClick(final View v) {
switch (v.getId()) {
case R.id.btn_next:
if (noOptionCount == 0) {
YoYo.with(Techniques.BounceIn).onEnd(new YoYo.AnimatorCallback() {
YoYo.with(Techniques.Bounce).onEnd(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
binding.btnNext.setAlpha(0.4f);
Snackbar.make(binding.getRoot(), "Veuillez cocher une case pour continuer", BaseTransientBottomBar.LENGTH_SHORT).show();
Snackbar.make(binding.getRoot(), getString(R.string.halt_select_a_case_to_continue), BaseTransientBottomBar.LENGTH_SHORT).show();
}
}).playOn(v);
} else {
Expand All @@ -198,7 +198,7 @@ public void call(Animator animator) {
break;
case R.id.btn_no_syptom:

YoYo.with(Techniques.BounceInDown).onEnd(new YoYo.AnimatorCallback() {
YoYo.with(Techniques.BounceIn).onEnd(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
if (mCallback != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
sDiagnosisOptions = getResources().getStringArray(R.array.diagnosis_second_options);

try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,


try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
sDiagnosisOptionsDepth3 = getResources().getStringArray(R.array.diagnosis_options_fourth_depth3);

try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand Down Expand Up @@ -342,7 +342,7 @@ public void onAnimationCancel(View view) {
binding.fourthScreen.setVisibility(View.VISIBLE);
binding.resultBg.setVisibility(View.VISIBLE);

binding.toolbarTitle.setText(getString(R.string.diagnisis_result_toolbar_title));
binding.appBar.toolbarTitle.setText(getString(R.string.diagnisis_result_toolbar_title));

ViewCompat.animate(binding.thirdScreen).alpha(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,


try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand All @@ -77,7 +77,7 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
binding.btnFourthPreventionOthers.setOnClickListener(this);

binding.getRoot().setTranslationY(-getResources().getDisplayMetrics().heightPixels);
binding.toolbarTitle.setText(getResources().getString(R.string.diagnisis_result_toolbar_title));
binding.appBar.toolbarTitle.setText(getResources().getString(R.string.diagnisis_result_toolbar_title));

ViewCompat.animate(binding.getRoot()).translationY(0).setDuration(1000).setListener(new ViewPropertyAnimatorListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
sDiagnosisOptionsDetails = getResources().getStringArray(R.array.diagnosis_second_options_details);

try {
((AppCompatActivity) getActivity()).setSupportActionBar(binding.toolbar);
((AppCompatActivity) getActivity()).setSupportActionBar(binding.appBar.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception ex) {
ex.printStackTrace();
}

binding.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
binding.appBar.appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset == 0) {
//EXPANDED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {

//COLLAPSED;

binding.collapsingToolabar.setTitleEnabled(false);
binding.appBar.collapsingToolabar.setTitleEnabled(false);
} else {

//IDDLE
Expand Down
51 changes: 4 additions & 47 deletions app/src/main/res/layout/fragment_diagnosis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,11 @@
android:background="@color/layouts_main_white_bg">


<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
<include
layout="@layout/include_diagnosis_appbar"
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolabar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:background="@color/layouts_main_white_bg"
app:contentScrim="@color/colorPrimary"
app:expandedTitleGravity="center_horizontal|top"
app:layout_scrollFlags="scroll|exitUntilCollapsed">


<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="@dimen/toolbar_api_version_top_margin"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title=" ">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="monospace"
android:text="@string/main_diagnosis_toolbar_title"
android:textSize="@dimen/tootlar_custom_title_text_size"
android:visibility="visible"
app:layout_collapseMode="pin" />
</androidx.appcompat.widget.Toolbar>


</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
android:layout_height="wrap_content"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down
51 changes: 4 additions & 47 deletions app/src/main/res/layout/fragment_diagnosis_first_malaria.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,11 @@
android:layout_height="match_parent">


<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
<include
layout="@layout/include_diagnosis_appbar"
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolabar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:background="@color/layouts_main_white_bg"
app:contentScrim="@color/colorPrimary"
app:expandedTitleGravity="center_horizontal|top"
app:layout_scrollFlags="scroll|exitUntilCollapsed">


<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="@dimen/toolbar_api_version_top_margin"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title=" ">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="monospace"
android:text="@string/main_diagnosis_toolbar_title"
android:textSize="@dimen/tootlar_custom_title_text_size"
android:visibility="visible"
app:layout_collapseMode="pin" />
</androidx.appcompat.widget.Toolbar>


</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
android:layout_height="wrap_content"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down
Loading

0 comments on commit 6420881

Please sign in to comment.