Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show location notice that can redirect to location settings, in order…
… to inform the user.
- Loading branch information
Showing
8 changed files
with
110 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
privacypolice/src/main/java/be/uhasselt/privacypolice/LocationNoticeActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package be.uhasselt.privacypolice; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.provider.Settings; | ||
import android.view.View; | ||
|
||
/** | ||
* Activity that shows the user why location access might be needed, and that allows to take action | ||
* (either open location settings or disable the notification from showing) | ||
*/ | ||
public class LocationNoticeActivity extends Activity{ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.activity_locationnotice); | ||
} | ||
|
||
public void openLocationSettings(View view) { | ||
Intent locationSettingsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); | ||
startActivity(locationSettingsIntent); | ||
} | ||
|
||
public void disableNotification(View view) { | ||
// TODO | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
privacypolice/src/main/res/layout/activity_locationnotice.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center_horizontal"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:text="@string/location_permission_full_explanation" | ||
android:id="@+id/location_explanation" | ||
android:padding="@dimen/activity_horizontal_margin" /> | ||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/location_open_settings" | ||
android:id="@+id/open_location_settings" | ||
android:padding="@dimen/activity_horizontal_margin" | ||
android:onClick="openLocationSettings" /> | ||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/location_ignore_notice" | ||
android:id="@+id/button2" | ||
android:padding="@dimen/activity_horizontal_margin" | ||
android:onClick="disableNotification" /> | ||
</LinearLayout> |
22 changes: 19 additions & 3 deletions
22
privacypolice/src/main/res/layout/activity_preferences.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
<FrameLayout | ||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/inflatable_prefs" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
</FrameLayout> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/location_permission_explanation" | ||
android:id="@+id/location_notice" | ||
android:background="#dcedc8" | ||
android:padding="@dimen/activity_horizontal_margin" | ||
android:visibility="gone" | ||
android:onClick="openLocationNotice" /> | ||
|
||
<FrameLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/inflatable_prefs"> | ||
</FrameLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters