Skip to content

Commit

Permalink
Permissions settings page reworked
Browse files Browse the repository at this point in the history
- features added
- can view privacy policy
- can change default home app
  • Loading branch information
devarshukani committed Nov 21, 2023
1 parent b83f401 commit 967622a
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,51 @@

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.LinearLayout;

import com.devarshukani.clearmindlauncher.Helper.AnimateLinearLayoutButton;
import com.devarshukani.clearmindlauncher.R;

public class PermissionsSettingsActivity extends AppCompatActivity {

LinearLayout ButtonDefaultLauncher;
LinearLayout ButtonPrivacyPolicy;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_permissions_settings);

ButtonDefaultLauncher = findViewById(R.id.ButtonDefaultLauncher);
ButtonPrivacyPolicy = findViewById(R.id.ButtonPrivacyPolicy);

AnimateLinearLayoutButton anim = new AnimateLinearLayoutButton();

ButtonDefaultLauncher.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
anim.animateButtonClick(ButtonDefaultLauncher);
Intent intent = new Intent(Settings.ACTION_HOME_SETTINGS);
startActivity(intent);
}
});

ButtonPrivacyPolicy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
anim.animateButtonClick(ButtonPrivacyPolicy);
String privacyPolicyURL = "https://doc-hosting.flycricket.io/clearmind-launcher-privacy-policy/3100f44e-70a2-49ce-9805-db0d87143fc4/privacy";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(privacyPolicyURL));
startActivity(browserIntent);
}
});



}
}
48 changes: 45 additions & 3 deletions app/src/main/res/layout/activity_permissions_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_marginTop="30dp"/>

<LinearLayout
android:id="@+id/ButtonName1"
android:id="@+id/ButtonDefaultLauncher"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/search_bar_background"
Expand All @@ -40,7 +40,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="Title"
android:text="Set Default Launcher"
android:fontFamily="@font/sf_pro_display_regular"
android:textStyle="bold"
android:textColor="@color/PrimaryTextColor"
Expand All @@ -51,7 +51,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="Sub Text"
android:text="Change default Home App"
android:fontFamily="@font/sf_pro_display_regular"
android:textColor="@color/SecondaryTextColor"
android:layout_marginBottom="15dp"
Expand All @@ -62,6 +62,48 @@

</LinearLayout>


<LinearLayout
android:id="@+id/ButtonPrivacyPolicy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/search_bar_background"
android:layout_marginTop="20dp"
android:orientation="horizontal">

<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="Privacy Policy"
android:fontFamily="@font/sf_pro_display_regular"
android:textStyle="bold"
android:textColor="@color/PrimaryTextColor"
android:layout_marginTop="12dp"
android:layout_marginHorizontal="15dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="Privacy Policy of ClearMind Launcher"
android:fontFamily="@font/sf_pro_display_regular"
android:textColor="@color/SecondaryTextColor"
android:layout_marginBottom="15dp"
android:layout_marginHorizontal="15dp"/>


</LinearLayout>

</LinearLayout>


</LinearLayout>

</ScrollView>

0 comments on commit 967622a

Please sign in to comment.