This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Adding back button in settings activity #369
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aea623a
Adding back button in settings activity
htg2704 8844d74
Adding back button in settings activity(fixing minor issues of previo…
htg2704 879ae71
Adding back button in settings activity(fixing minor issues of previo…
htg2704 526ef0f
Adding back button in settings activity(fixing minor issues of previo…
htg2704 5bf354b
Adding back button in settings activity(fixing minor issues of previo…
htg2704 95e989a
Adding back button in settings activity(fixing minor issues of previo…
htg2704 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Oct 28 17:15:18 IST 2019 | ||
#Wed Mar 11 20:02:17 IST 2020 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import android.bluetooth.BluetoothAdapter; | ||
import android.content.DialogInterface; | ||
import android.content.Intent; | ||
import android.content.SharedPreferences; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
|
@@ -21,20 +22,25 @@ | |
import android.view.WindowManager; | ||
import android.widget.Toast; | ||
|
||
import androidx.appcompat.app.ActionBar; | ||
import androidx.appcompat.app.AlertDialog; | ||
import androidx.appcompat.app.AppCompatDelegate; | ||
import androidx.appcompat.widget.Toolbar; | ||
|
||
import com.google.android.material.textfield.TextInputEditText; | ||
import com.google.android.material.textfield.TextInputLayout; | ||
|
||
import org.odk.share.R; | ||
import org.odk.share.views.ui.main.MainActivity; | ||
|
||
/** | ||
* Created by laksh on 5/27/2018. | ||
*/ | ||
|
||
public class SettingsActivity extends PreferenceActivity { | ||
|
||
|
||
|
||
EditTextPreference hotspotNamePreference; | ||
EditTextPreference bluetoothNamePreference; | ||
Preference hotspotPasswordPreference; | ||
|
@@ -48,11 +54,20 @@ public class SettingsActivity extends PreferenceActivity { | |
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
|
||
super.onCreate(savedInstanceState); | ||
ViewGroup root = getRootView(); | ||
Toolbar toolbar = (Toolbar) View.inflate(this, R.layout.toolbar, null); | ||
toolbar.setTitle(getString(R.string.settings)); | ||
root.addView(toolbar, 0); | ||
toolbar.setNavigationIcon(R.drawable.ic_back_navigation); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
|
||
}); | ||
|
||
addPreferencesFromResource(R.xml.preferences_menu); | ||
addPreferences(); | ||
|
@@ -75,6 +90,7 @@ private void addPreferences() { | |
btSecureModePreference = (CheckBoxPreference) findPreference(PreferenceKeys.KEY_BLUETOOTH_SECURE_MODE); | ||
odkDestinationDirPreference = (EditTextPreference) findPreference(PreferenceKeys.KEY_ODK_DESTINATION_DIR); | ||
|
||
|
||
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); | ||
|
||
defaultMethodPreference.setSummary(prefs.getString(PreferenceKeys.KEY_DEFAULT_TRANSFER_METHOD, | ||
|
@@ -217,16 +233,16 @@ public void onShow(DialogInterface dialog) { | |
edtpass.addTextChangedListener(new TextWatcher() { | ||
@Override | ||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | ||
|
||
} | ||
|
||
@Override | ||
public void onTextChanged(CharSequence s, int start, int before, int count) { | ||
|
||
if (edtpass.getText().toString().length() >= 8) { | ||
((AlertDialog) dialog) .getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); | ||
((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); | ||
} else { | ||
((AlertDialog) dialog) .getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); | ||
((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); | ||
} | ||
} | ||
|
||
|
@@ -238,12 +254,8 @@ public void afterTextChanged(Editable s) { | |
} | ||
}); | ||
|
||
|
||
alertDialog.show(); | ||
|
||
alertDialog.setCancelable(true); | ||
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. avoid blank spaces |
||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
skunkworks_crow/src/main/res/drawable/ic_back_navigation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
|
||
<path | ||
android:pathData="M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z" | ||
/> | ||
<path | ||
android:fillColor="#FFFFFF" | ||
android:pathData="M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z" | ||
/> | ||
</vector> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert whatever changes you did in manifest file, as there is no need