Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wade
DnsChanger
Commits
5499f2ed
Commit
5499f2ed
authored
Apr 10, 2018
by
Daniel Wolf
Browse files
Removed the new features dialog
parent
359e5116
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/dnschanger/dialogs/NewFeaturesDialog.java
deleted
100644 → 0
View file @
359e5116
package
com.frostnerd.dnschanger.dialogs
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.support.annotation.NonNull
;
import
android.view.View
;
import
android.widget.ArrayAdapter
;
import
android.widget.ListView
;
import
android.widget.TextView
;
import
com.frostnerd.dnschanger.BuildConfig
;
import
com.frostnerd.dnschanger.R
;
import
com.frostnerd.dnschanger.util.ThemeHandler
;
import
com.frostnerd.dnschanger.util.Preferences
;
import
com.frostnerd.utils.lifecyclehelper.UtilityDialog
;
/**
* Copyright Daniel Wolf 2017
* All rights reserved.
* <p>
* Terms on usage of my code can be found here: https://git.frostnerd.com/PublicAndroidApps/DnsChanger/blob/master/README.md
* <p>
* <p>
* development@frostnerd.com
*/
public
class
NewFeaturesDialog
extends
UtilityDialog
{
public
NewFeaturesDialog
(
@NonNull
Context
context
)
{
super
(
context
,
ThemeHandler
.
getDialogTheme
(
context
));
setCancelable
(
true
);
setCanceledOnTouchOutside
(
true
);
setButton
(
BUTTON_POSITIVE
,
context
.
getString
(
R
.
string
.
close
),
new
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
dialogInterface
.
dismiss
();
}
});
setTitle
(
R
.
string
.
new_features
);
View
content
;
setView
(
content
=
getLayoutInflater
().
inflate
(
R
.
layout
.
dialog_new_features
,
null
,
false
));
((
TextView
)
content
.
findViewById
(
R
.
id
.
text
)).
setText
(
BuildConfig
.
VERSION_NAME
);
ListView
list
=
content
.
findViewById
(
R
.
id
.
list
);
String
[]
arr
=
context
.
getResources
().
getStringArray
(
getStringArrayID
(
context
));
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++){
arr
[
i
]
=
"- "
+
arr
[
i
];
}
list
.
setAdapter
(
new
ArrayAdapter
<>(
context
,
R
.
layout
.
item_new_feature
,
arr
));
Preferences
.
getInstance
(
context
).
put
(
"features_"
+
BuildConfig
.
VERSION_NAME
.
replace
(
"."
,
"_"
),
true
);
}
@Override
protected
void
destroy
()
{
}
private
static
int
getStringArrayID
(
Context
context
){
return
context
.
getResources
().
getIdentifier
(
"features_"
+
BuildConfig
.
VERSION_NAME
.
replace
(
"."
,
"_"
),
"array"
,
context
.
getPackageName
());
}
public
static
boolean
shouldShowDialog
(
Context
context
)
{
return
getStringArrayID
(
context
)
!=
0
&&
!
Preferences
.
getInstance
(
context
).
getBoolean
(
"features_"
+
BuildConfig
.
VERSION_NAME
.
replace
(
"."
,
"_"
),
false
);
}
}
app/src/main/java/com/frostnerd/dnschanger/fragments/MainFragment.java
View file @
5499f2ed
...
...
@@ -42,7 +42,6 @@ import com.frostnerd.dnschanger.R;
import
com.frostnerd.dnschanger.activities.MainActivity
;
import
com.frostnerd.dnschanger.database.entities.DNSEntry
;
import
com.frostnerd.dnschanger.database.entities.IPPortPair
;
import
com.frostnerd.dnschanger.dialogs.NewFeaturesDialog
;
import
com.frostnerd.dnschanger.dialogs.VPNInfoDialog
;
import
com.frostnerd.dnschanger.services.DNSVpnService
;
import
com.frostnerd.dnschanger.util.DNSQueryUtil
;
...
...
@@ -239,9 +238,6 @@ public class MainFragment extends Fragment {
}
});
setEditTextLabel
();
if
(
NewFeaturesDialog
.
shouldShowDialog
(
requireContext
())){
new
NewFeaturesDialog
(
requireContext
()).
show
();
}
LogFactory
.
writeMessage
(
requireContext
(),
LOG_TAG
,
"Done with OnCreate"
);
}
...
...
Write
Preview
Supports
Markdown
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