@@ -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+
0 commit comments