Skip to content

Commit

Permalink
Merge pull request #1616 from danishjamal104/fix-1614
Browse files Browse the repository at this point in the history
Fixes #1614 Intro added in SearchFragment
  • Loading branch information
iamsh4shank authored Jul 13, 2021
2 parents 1a4c0ec + 4ff2b55 commit ab6f0d2
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mifosng-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
jcenter()
}
dependencies {
Expand Down Expand Up @@ -219,6 +220,8 @@ dependencies {
implementation 'com.facebook.stetho:stetho:1.3.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.3.1'

implementation 'com.github.deano2390:MaterialShowcaseView:1.3.4'


implementation "com.joanzapata.iconify:android-iconify-material:2.1.1" // (v2.0.0)
implementation('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
Expand Down Expand Up @@ -49,12 +50,17 @@
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import uk.co.deanwild.materialshowcaseview.MaterialShowcaseSequence;
import uk.co.deanwild.materialshowcaseview.ShowcaseConfig;

public class SearchFragment extends MifosBaseFragment implements SearchMvpView,
RecyclerItemClickListener.OnItemClickListener, AdapterView.OnItemSelectedListener {

private static final String LOG_TAG = SearchFragment.class.getSimpleName();

@BindView(R.id.btn_search)
Button bt_search;

@BindView(R.id.et_search)
EditText et_search;

Expand Down Expand Up @@ -131,12 +137,46 @@ public void showUserInterface() {
rv_search.addOnItemTouchListener(new RecyclerItemClickListener(getActivity(), this));
rv_search.setHasFixedSize(true);
rv_search.setAdapter(searchAdapter);

cb_exactMatch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
onClickSearch();
}
});

showGuide();
}

void showGuide() {
ShowcaseConfig config = new ShowcaseConfig();
config.setDelay(250); // half second between each showcase view

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(getActivity(), "123");

sequence.setConfig(config);

String et_search_intro = getString(R.string.et_search_intro);
int i = 1;
for (String s: searchOptionsValues) {
et_search_intro += "\n" + i + '.' + s;
i++;
}

String sp_search_intro = getString(R.string.sp_search_intro);
String cb_exactMatch_intro = getString(R.string.cb_exactMatch_intro);
String bt_search_intro = getString(R.string.bt_search_intro);

sequence.addSequenceItem(et_search,
et_search_intro, getString(R.string.got_it));
sequence.addSequenceItem(sp_search,
sp_search_intro, getString(R.string.next));
sequence.addSequenceItem(cb_exactMatch,
cb_exactMatch_intro, getString(R.string.next));
sequence.addSequenceItem(bt_search,
bt_search_intro, getString(R.string.finish));

sequence.start();
}


Expand Down
13 changes: 13 additions & 0 deletions mifosng-android/src/main/java/com/mifos/utils/PrefManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class PrefManager {
private static final String USER_DETAILS = "user_details";
private static final String PASSCODE = "passcode";
private static final String PASSCODE_STATUS = "passcode_status";
public static final String FIRST_TIME_APP_LAUNCH = "preferences_app_launched";

private static Gson gson = new Gson();

Expand Down Expand Up @@ -203,4 +204,16 @@ public static void setPassCodeStatus(boolean statusCode) {
public static Boolean getPassCodeStatus() {
return getBoolean(PASSCODE_STATUS, false);
}

/**
* @return true if app is launched is first time and set the value to
* false which is returned whenever next time it is called
*/
public static Boolean isAppFirstTimeLaunched() {
Boolean result = getBoolean(FIRST_TIME_APP_LAUNCH, true);
if (result) {
putBoolean(FIRST_TIME_APP_LAUNCH, false);
}
return result;
}
}
9 changes: 9 additions & 0 deletions mifosng-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@
<string name="entry">ENTRY</string>
<string name="network_issue">Network Issue</string>
<string name="accounts">Accounts</string>

>>>>>>> 9e9df49d (Intro added in SearchFragment)
<string name="dark_mode">Dark Mode</string>
<string name="ui">UI</string>
<string name="dark_mode_def_value">MODE_NIGHT_FOLLOW_SYSTEM</string>
Expand Down Expand Up @@ -898,4 +900,11 @@
<string name="change_passcode">Change Passcode</string>
<string name="change_app_passcode">Change App Passcode</string>

<string name="got_it">GOT IT</string>
<string name="finish">FINISH</string>
<string name="sp_search_intro">Filter out the results using this dropdown</string>
<string name="cb_exactMatch_intro">To get the result matching exactly the keyword entered.\n Simply check this box</string>
<string name="bt_search_intro">Click this button to make a search.\nClick on three dot icon in top right to create new Client/ Center/ Group or logout.\nExplore the menu by clicking on 3 line icon on top left.</string>
<string name="et_search_intro">Enter keyword to search among</string>

</resources>

0 comments on commit ab6f0d2

Please sign in to comment.