Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
81682f05
Commit
81682f05
authored
Jan 14, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New SecuritySettings activity, SecuritySettingsFragment and SecurityClearCertificateDialog.
parent
b67909d5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
38 deletions
+107
-38
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-0
ContactResetOfflineSettingsDialog.java
...oid/ui/preferences/ContactResetOfflineSettingsDialog.java
+0
-1
PreferenceEditor.java
...a/com/xabber/android/ui/preferences/PreferenceEditor.java
+0
-12
PreferencesFragment.java
...om/xabber/android/ui/preferences/PreferencesFragment.java
+0
-2
SecurityClearCertificateDialog.java
...ndroid/ui/preferences/SecurityClearCertificateDialog.java
+25
-0
SecuritySettings.java
...a/com/xabber/android/ui/preferences/SecuritySettings.java
+25
-0
SecuritySettingsFragment.java
...bber/android/ui/preferences/SecuritySettingsFragment.java
+17
-0
preference_editor.xml
app/src/main/res/xml/preference_editor.xml
+5
-23
preference_security.xml
app/src/main/res/xml/preference_security.xml
+26
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
81682f05
...
...
@@ -352,6 +352,15 @@
android:value=
"com.xabber.android.ui.preferences.PreferenceEditor"
/>
</activity>
<activity
android:name=
"com.xabber.android.ui.preferences.SecuritySettings"
android:parentActivityName=
"com.xabber.android.ui.preferences.PreferenceEditor"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"com.xabber.android.ui.preferences.PreferenceEditor"
/>
</activity>
<service
android:name=
"com.xabber.android.service.XabberService"
/>
<service
android:name=
"com.xabber.android.service.SyncAdapterService"
...
...
app/src/main/java/com/xabber/android/ui/preferences/ContactResetOfflineSettingsDialog.java
View file @
81682f05
...
...
@@ -18,6 +18,5 @@ public class ContactResetOfflineSettingsDialog extends DialogPreference {
if
(
positiveResult
)
{
GroupManager
.
getInstance
().
resetShowOfflineModes
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/PreferenceEditor.java
View file @
81682f05
...
...
@@ -61,9 +61,6 @@ public class PreferenceEditor extends ManagedActivity
public
boolean
onPreferenceClick
(
Preference
preference
)
{
if
(
preference
.
getKey
().
equals
(
getString
(
R
.
string
.
cache_clear_key
)))
{
showDialog
(
R
.
string
.
cache_clear_warning
);
}
else
if
(
preference
.
getKey
().
equals
(
getString
(
R
.
string
.
security_clear_certificate_key
)))
{
showDialog
(
R
.
string
.
security_clear_certificate_warning
);
}
return
false
;
}
...
...
@@ -75,11 +72,6 @@ public class PreferenceEditor extends ManagedActivity
case
R
.
string
.
cache_clear_warning
:
return
new
ConfirmDialogBuilder
(
this
,
R
.
string
.
cache_clear_warning
,
this
).
setMessage
(
R
.
string
.
cache_clear_warning
).
create
();
case
R
.
string
.
security_clear_certificate_warning
:
return
new
ConfirmDialogBuilder
(
this
,
R
.
string
.
security_clear_certificate_warning
,
this
)
.
setMessage
(
R
.
string
.
security_clear_certificate_warning
)
.
create
();
case
R
.
string
.
application_state_closing
:
ProgressDialog
progressDialog
=
new
ProgressDialog
(
this
);
progressDialog
...
...
@@ -102,10 +94,6 @@ public class PreferenceEditor extends ManagedActivity
Application
.
getInstance
().
requestToClose
();
showDialog
(
R
.
string
.
application_state_closing
);
break
;
case
R
.
string
.
security_clear_certificate_warning
:
CertificateManager
.
getInstance
().
removeCertificates
();
ConnectionManager
.
getInstance
().
updateConnections
(
true
);
break
;
}
}
...
...
app/src/main/java/com/xabber/android/ui/preferences/PreferencesFragment.java
View file @
81682f05
...
...
@@ -26,8 +26,6 @@ public class PreferencesFragment extends android.preference.PreferenceFragment {
getPreferenceScreen
().
findPreference
(
getString
(
R
.
string
.
cache_clear_key
))
.
setOnPreferenceClickListener
(
mListener
.
getOnPreferenceClickListener
());
getPreferenceScreen
().
findPreference
(
getString
(
R
.
string
.
security_clear_certificate_key
))
.
setOnPreferenceClickListener
(
mListener
.
getOnPreferenceClickListener
());
getPreferenceScreen
().
findPreference
(
getString
(
R
.
string
.
debug_log_key
))
.
setEnabled
(
LogManager
.
isDebugable
());
...
...
app/src/main/java/com/xabber/android/ui/preferences/SecurityClearCertificateDialog.java
0 → 100644
View file @
81682f05
package
com
.
xabber
.
android
.
ui
.
preferences
;
import
android.content.Context
;
import
android.preference.DialogPreference
;
import
android.util.AttributeSet
;
import
com.xabber.android.data.connection.CertificateManager
;
import
com.xabber.android.data.connection.ConnectionManager
;
public
class
SecurityClearCertificateDialog
extends
DialogPreference
{
public
SecurityClearCertificateDialog
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
@Override
protected
void
onDialogClosed
(
boolean
positiveResult
)
{
super
.
onDialogClosed
(
positiveResult
);
if
(
positiveResult
)
{
CertificateManager
.
getInstance
().
removeCertificates
();
ConnectionManager
.
getInstance
().
updateConnections
(
true
);
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/SecuritySettings.java
0 → 100644
View file @
81682f05
package
com
.
xabber
.
android
.
ui
.
preferences
;
import
android.os.Bundle
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
com.xabber.androiddev.R
;
public
class
SecuritySettings
extends
ManagedActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
isFinishing
())
return
;
setContentView
(
R
.
layout
.
activity_preferences
);
getActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
if
(
savedInstanceState
==
null
)
{
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity_container
,
new
SecuritySettingsFragment
()).
commit
();
}
}
}
app/src/main/java/com/xabber/android/ui/preferences/SecuritySettingsFragment.java
0 → 100644
View file @
81682f05
package
com
.
xabber
.
android
.
ui
.
preferences
;
import
android.os.Bundle
;
import
com.xabber.android.ui.helper.PreferenceSummaryHelper
;
import
com.xabber.androiddev.R
;
public
class
SecuritySettingsFragment
extends
android
.
preference
.
PreferenceFragment
{
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
addPreferencesFromResource
(
R
.
xml
.
preference_security
);
PreferenceSummaryHelper
.
updateSummary
(
getPreferenceScreen
());
}
}
app/src/main/res/xml/preference_editor.xml
View file @
81682f05
...
...
@@ -62,32 +62,14 @@
android:targetPackage=
"@string/application_package"
android:targetClass=
"com.xabber.android.ui.preferences.ConnectionSettings"
/>
</Preference>
<Preference
Screen
<Preference
android:title=
"@string/preference_security"
android:key=
"@string/preference_security"
>
<CheckBoxPreference
android:title=
"@string/security_check_certificate"
android:key=
"@string/security_check_certificate_key"
android:defaultValue=
"@bool/security_check_certificate_default"
/>
<PreferenceScreen
android:title=
"@string/security_clear_certificate"
android:key=
"@string/security_clear_certificate_key"
/>
<ListPreference
android:title=
"@string/security_otr_mode"
android:key=
"@string/security_otr_mode_key"
android:entries=
"@array/security_otr_mode_entries"
android:entryValues=
"@array/security_otr_mode_entryvalues"
android:defaultValue=
"@string/security_otr_mode_default"
/>
<CheckBoxPreference
android:title=
"@string/security_otr_history"
android:key=
"@string/security_otr_history_key"
android:defaultValue=
"@bool/security_otr_history_default"
/>
</PreferenceScreen>
<intent
android:targetPackage=
"@string/application_package"
android:targetClass=
"com.xabber.android.ui.preferences.SecuritySettings"
/>
</Preference>
<PreferenceScreen
android:title=
"@string/preference_debug"
android:key=
"@string/preference_debug"
...
...
app/src/main/res/xml/preference_security.xml
0 → 100644
View file @
81682f05
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<CheckBoxPreference
android:title=
"@string/security_check_certificate"
android:key=
"@string/security_check_certificate_key"
android:defaultValue=
"@bool/security_check_certificate_default"
/>
<com.xabber.android.ui.preferences.SecurityClearCertificateDialog
android:title=
"@string/security_clear_certificate"
android:key=
"@string/security_clear_certificate_key"
android:dialogMessage=
"@string/security_clear_certificate_warning"
/>
<ListPreference
android:title=
"@string/security_otr_mode"
android:key=
"@string/security_otr_mode_key"
android:entries=
"@array/security_otr_mode_entries"
android:entryValues=
"@array/security_otr_mode_entryvalues"
android:defaultValue=
"@string/security_otr_mode_default"
/>
<CheckBoxPreference
android:title=
"@string/security_otr_history"
android:key=
"@string/security_otr_history_key"
android:defaultValue=
"@bool/security_otr_history_default"
/>
</PreferenceScreen>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment