Skip to content

Commit

Permalink
Fix issue NitishGadangi#27
Browse files Browse the repository at this point in the history
  • Loading branch information
Hristian Iliev committed Oct 3, 2020
1 parent 65fd28c commit a571b92
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.nitish.privacyindicator.fragments;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
Expand All @@ -9,12 +11,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.*;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand All @@ -30,6 +27,8 @@

public class FragmentHome extends Fragment {

private static int LAUNCHED_ACCESSIBILITY_SETTINGS = 1;

//Root Views
private View root;
private View contentServiceEnabled;
Expand Down Expand Up @@ -177,8 +176,10 @@ private void setUpListeners() {
mainSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showGuidanceToast();

Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(intent);
startActivityForResult(intent, LAUNCHED_ACCESSIBILITY_SETTINGS);
}
});

Expand Down Expand Up @@ -318,6 +319,15 @@ public void onStopTrackingTouch(SeekBar seekBar) {
});
}

private void showGuidanceToast() {
Context context = getActivity().getApplicationContext();
CharSequence text = "Please enable \"Privacy Indicators\" under downloaded services section.";
int duration = Toast.LENGTH_LONG;

Toast toast = Toast.makeText(context, text, duration);
toast.show();
}

CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
Expand Down

0 comments on commit a571b92

Please sign in to comment.