[tor-commits] [orbot/master] Added comments for better understanding
n8fr8 at torproject.org
n8fr8 at torproject.org
Tue Apr 28 21:05:02 UTC 2020
commit f4580cf3a7e6802378502252ebb1845921638e4e
Author: Hashik Donthineni <hashikdonthineni at gmail.com>
Date: Thu Feb 27 22:14:28 2020 +0530
Added comments for better understanding
---
.../org/torproject/android/ui/onboarding/CustomSlideBigText.java | 8 +++++---
.../org/torproject/android/ui/onboarding/OnboardingActivity.java | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/CustomSlideBigText.java b/app/src/main/java/org/torproject/android/ui/onboarding/CustomSlideBigText.java
index 17afebda..f5d814f1 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/CustomSlideBigText.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/CustomSlideBigText.java
@@ -22,8 +22,8 @@ public class CustomSlideBigText extends Fragment {
private String mButtonText;
private String mSubTitle;
private View.OnClickListener mButtonListener;
- TextView tv, title;
- Button button;
+ private TextView tv, title;
+ private Button button;
public static CustomSlideBigText newInstance(int layoutResId) {
CustomSlideBigText sampleSlide = new CustomSlideBigText();
@@ -81,11 +81,12 @@ public class CustomSlideBigText extends Fragment {
}
+ //Restoring the data
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (savedInstanceState != null) {
- savedInstanceState.getString(getResources().getString(R.string.Title));
+ title.setText(savedInstanceState.getString(getResources().getString(R.string.Title)));
tv.setText(savedInstanceState.getString(getResources().getString(R.string.SubTitle)));
if (mButtonText != null) {
button.setText(savedInstanceState.getString(getResources().getString(R.string.ButtonText)));
@@ -94,6 +95,7 @@ public class CustomSlideBigText extends Fragment {
}
}
+ //Saving the data
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
index 3038f6de..2a98edb4 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
@@ -30,7 +30,7 @@ public class OnboardingActivity extends AppIntro {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- if (savedInstanceState != null) {
+ if (savedInstanceState != null) { //Restoring the fragments
welcome = (CustomSlideBigText) getSupportFragmentManager().getFragment(savedInstanceState, getResources().getString(R.string.WelcomeFragment));
intro2 = (CustomSlideBigText) getSupportFragmentManager().getFragment(savedInstanceState, getResources().getString(R.string.Intro2Fragment));
cs2 = (CustomSlideBigText) getSupportFragmentManager().getFragment(savedInstanceState, getResources().getString(R.string.CS2Fragment));
@@ -106,7 +106,7 @@ public class OnboardingActivity extends AppIntro {
}
@Override
- protected void onSaveInstanceState(Bundle outState) {
+ protected void onSaveInstanceState(Bundle outState) { //Saving the fragments
super.onSaveInstanceState(outState);
//Save the fragment's instance
More information about the tor-commits
mailing list