Skip to content

Commit 5bc187f

Browse files
authored
Merge pull request #30 from BranchMetrics/SDK-1441-Privacy-Policy
SDK-1441 Added Privacy Policy button
2 parents 4bb6a58 + 897dc33 commit 5bc187f

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

app/src/main/java/io/branch/branchster/fragment/InfoFragment.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class InfoFragment extends Fragment implements View.OnClickListener {
2424
private static final String TAG = "InfoFragment";
2525
private OnFragmentInteractionListener mListener;
2626
private Button mButton;
27+
private Button mButtonPrivacyPolicy;
2728

2829

2930
public static InfoFragment newInstance() {
@@ -46,6 +47,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
4647
View v = inflater.inflate(R.layout.fragment_info, container, false);
4748
mButton = (Button) v.findViewById(R.id.button);
4849
mButton.setOnClickListener(this);
50+
mButtonPrivacyPolicy = (Button) v.findViewById(R.id.buttonPrivacyPolicy);
51+
mButtonPrivacyPolicy.setOnClickListener(this);
4952
try {
5053
String versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName;
5154
((TextView)v.findViewById(R.id.version_name_txt)).setText(String.format(getString(R.string.version_name),versionName));
@@ -84,9 +87,21 @@ public interface OnFragmentInteractionListener {
8487

8588
@Override
8689
public void onClick(View view) {
87-
Uri webpage = Uri.parse("http://branch.io?bmp=branchster-android");
90+
String url;
91+
switch (view.getId()) {
92+
case R.id.button:
93+
url = "http://branch.io?bmp=branchster-android";
94+
break;
95+
case R.id.buttonPrivacyPolicy:
96+
url = "https://branch.io/policies/privacy-policy/";
97+
break;
98+
default:
99+
return;
100+
}
101+
Uri webpage = Uri.parse(url);
88102
Intent i = new Intent(Intent.ACTION_VIEW, webpage);
89103
startActivity(i);
90104
}
91105

92106
}
107+

app/src/main/res/layout/fragment_info.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,21 @@
3333
android:id="@+id/button"
3434
android:layout_gravity="center_horizontal" />
3535

36+
<Button
37+
android:id="@+id/buttonPrivacyPolicy"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:layout_gravity="center_horizontal"
41+
android:text="Privacy Policy" />
42+
3643
<TextView
3744
android:id="@+id/version_name_txt"
3845
android:layout_width="match_parent"
39-
android:layout_height="match_parent"
40-
android:background="@android:color/transparent"
41-
android:textAppearance="@android:style/TextAppearance.Small"
42-
android:layout_margin="5dp"
46+
android:layout_height="260dp"
4347
android:layout_gravity="bottom"
44-
android:gravity="bottom" />
48+
android:layout_margin="5dp"
49+
android:background="@android:color/transparent"
50+
android:gravity="bottom"
51+
android:textAppearance="@android:style/TextAppearance.Small" />
4552

4653
</LinearLayout>

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.9.2
2-
VERSION_CODE=010902
1+
VERSION_NAME=1.9.3
2+
VERSION_CODE=010903
33

44
ANDROID_BUILD_TARGET_SDK_MINIMUM=16
55
ANDROID_BUILD_TARGET_SDK_VERSION=30

0 commit comments

Comments
 (0)