-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hideable button to switch on/off URL restrictions
Show built-in avatar in restricted mode
- Loading branch information
1 parent
7149055
commit 43a0702
Showing
13 changed files
with
178 additions
and
3 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
75 changes: 75 additions & 0 deletions
75
app/src/main/java/org/woheller69/gptassist/SwipeTouchListener.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,75 @@ | ||
package org.woheller69.gptassist; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.content.Context; | ||
import android.view.GestureDetector; | ||
import android.view.MotionEvent; | ||
import android.view.View; | ||
import android.view.View.OnTouchListener; | ||
|
||
@SuppressWarnings("WeakerAccess") | ||
public class SwipeTouchListener implements OnTouchListener { | ||
|
||
private final GestureDetector gestureDetector; | ||
|
||
public SwipeTouchListener(Context context) { | ||
gestureDetector = new GestureDetector(context, new GestureListener()); | ||
} | ||
|
||
@SuppressLint("ClickableViewAccessibility") | ||
@Override | ||
public boolean onTouch(View v, MotionEvent event) { | ||
return gestureDetector.onTouchEvent(event); | ||
} | ||
|
||
public void onSwipeRight() {} | ||
|
||
public void onSwipeLeft() {} | ||
|
||
public void onSwipeTop() {} | ||
|
||
public void onSwipeBottom() {} | ||
|
||
@SuppressWarnings("NullableProblems") | ||
private final class GestureListener extends GestureDetector.SimpleOnGestureListener { | ||
|
||
private static final int SWIPE_THRESHOLD = 100; | ||
private static final int SWIPE_VELOCITY_THRESHOLD = 100; | ||
|
||
@SuppressWarnings("NullableProblems") | ||
@Override | ||
public boolean onDown(MotionEvent e) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { | ||
if (e1!=null && e2!=null) { | ||
try { | ||
float diffY = e2.getY() - e1.getY(); | ||
float diffX = e2.getX() - e1.getX(); | ||
if (Math.abs(diffX) > Math.abs(diffY)) { | ||
if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) { | ||
if (diffX > 0) { | ||
onSwipeRight(); | ||
} else { | ||
onSwipeLeft(); | ||
} | ||
} | ||
} else if (Math.abs(diffY) > SWIPE_THRESHOLD && Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) { | ||
if (diffY > 0) { | ||
onSwipeBottom(); | ||
} else { | ||
onSwipeTop(); | ||
} | ||
} | ||
} catch (Exception exception) { | ||
exception.printStackTrace(); | ||
} | ||
} | ||
assert e1 != null; | ||
assert e2 != null; | ||
return super.onFling(e1, e2, velocityX, velocityY); | ||
} | ||
} | ||
} |
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,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | ||
|
||
<solid android:color="#BBBBBB"/> | ||
<size android:height="36dp" | ||
android:width="36dp"/> | ||
|
||
</shape> |
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,8 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:viewportHeight="8851" | ||
android:viewportWidth="8851" | ||
android:width="24dp" | ||
android:height="24dp"> | ||
<path android:fillColor="#192072" android:fillType="evenOdd" | ||
android:pathData="M4430,760L4469,766 4505,775 4538,785 4569,797 4598,811 4624,827 4647,843 4669,861 4706,900 4736,942 4759,984 4777,1027 4789,1069 4798,1108 4803,1142 4806,1194 4806,1214 4806,4025 4806,4029 4806,4039 4807,4046 4809,4054 4811,4062 4814,4071 4818,4079 4823,4087 4829,4095 4837,4102 4841,4105 4846,4107 4851,4110 4856,4112 4862,4114 4869,4115 4876,4116 4883,4116 4899,4115 4906,4113 4913,4112 4919,4110 4924,4107 4930,4104 4934,4101 4939,4098 4943,4094 4949,4086 4955,4078 4959,4069 4962,4060 4964,4052 4966,4044 4967,4037 4967,4026 4967,4022 4966,1689 4966,1671 4970,1625 4976,1594 4984,1559 4997,1523 5015,1484 5039,1446 5069,1409 5106,1375 5151,1344 5205,1318 5269,1298 5343,1285 5429,1280 5514,1285 5588,1298 5653,1318 5707,1344 5753,1375 5790,1409 5821,1446 5845,1484 5863,1522 5877,1559 5886,1593 5892,1624 5896,1670 5896,1688 5896,4846 5897,4849 5898,4856 5902,4867 5904,4873 5907,4879 5911,4885 5916,4891 5921,4896 5928,4901 5935,4906 5939,4907 5944,4909 5948,4910 5953,4911 5958,4911 5964,4912 5966,4912 5967,4911 5971,4909 5979,4902 6001,4874 6061,4774 6215,4472 6419,4032 6431,4006 6446,3976 6469,3938 6501,3893 6542,3844 6593,3793 6656,3742 6730,3693 6818,3648 6919,3609 7035,3578 7166,3557 7313,3548 7478,3554 7661,3576 7661,3576 7662,3577 7662,3577 7663,3578 7663,3580 7660,3604 7656,3622 7628,3720 7580,3861 6480,6578 6457,6643 6379,6814 6316,6929 6235,7057 6134,7193 6013,7334 5869,7475 5701,7612 5508,7739 5288,7854 5039,7951 4761,8025 4451,8073 4109,8090 3682,8065 3311,7994 3145,7943 2992,7883 2851,7815 2721,7740 2494,7570 2307,7381 2156,7179 2038,6970 1948,6761 1883,6559 1838,6369 1810,6200 1789,5946 1788,5875 1788,5857 1788,5852 1788,5851 1788,5850 1788,5850 1788,5850 1788,2645 1789,2628 1794,2581 1800,2550 1809,2515 1822,2478 1840,2440 1862,2402 1891,2365 1926,2330 1968,2299 1992,2285 2018,2273 2046,2262 2076,2253 2144,2240 2221,2235 2294,2240 2327,2245 2357,2253 2386,2262 2412,2273 2437,2285 2459,2299 2499,2330 2532,2365 2559,2402 2580,2440 2597,2478 2609,2515 2618,2550 2624,2581 2629,2628 2630,2645 2633,4130 2633,4133 2634,4141 2635,4147 2637,4153 2639,4159 2643,4166 2647,4173 2652,4179 2658,4185 2666,4191 2676,4195 2686,4199 2699,4201 2714,4202 2727,4201 2733,4200 2739,4199 2744,4197 2749,4195 2753,4193 2757,4191 2760,4188 2764,4185 2769,4179 2773,4173 2777,4166 2779,4159 2781,4153 2782,4147 2782,4141 2782,4133 2782,4130 2787,1674 2786,1654 2790,1599 2795,1563 2804,1522 2817,1479 2835,1434 2858,1389 2888,1345 2926,1304 2972,1268 2998,1252 3026,1237 3057,1224 3091,1213 3127,1205 3166,1198 3252,1193 3340,1198 3379,1204 3416,1213 3450,1224 3482,1236 3511,1251 3538,1267 3584,1302 3622,1342 3653,1385 3677,1429 3695,1473 3708,1516 3717,1556 3722,1592 3726,1645 3726,1666 3726,3992 3726,3995 3727,4005 3729,4018 3731,4026 3734,4034 3738,4042 3743,4049 3749,4056 3756,4063 3760,4066 3764,4068 3769,4070 3774,4072 3780,4074 3786,4075 3792,4076 3799,4076 3807,4076 3813,4075 3820,4074 3826,4072 3831,4070 3836,4068 3841,4065 3845,4063 3849,4059 3852,4056 3858,4049 3863,4041 3867,4033 3869,4025 3871,4018 3873,4010 3873,4004 3874,3994 3874,3990 3878,1217 3878,1197 3882,1145 3887,1110 3896,1071 3909,1029 3927,986 3950,943 3980,901 4018,862 4064,827 4090,811 4118,797 4149,785 4183,775 4219,766 4258,760 4430,760Z" /> | ||
</vector> |
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,8 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:viewportHeight="8851" | ||
android:viewportWidth="8851" | ||
android:width="24dp" | ||
android:height="24dp"> | ||
<path android:fillColor="#EEEEEE" android:fillType="evenOdd" | ||
android:pathData="M4430,760L4469,766 4505,775 4538,785 4569,797 4598,811 4624,827 4647,843 4669,861 4706,900 4736,942 4759,984 4777,1027 4789,1069 4798,1108 4803,1142 4806,1194 4806,1214 4806,4025 4806,4029 4806,4039 4807,4046 4809,4054 4811,4062 4814,4071 4818,4079 4823,4087 4829,4095 4837,4102 4841,4105 4846,4107 4851,4110 4856,4112 4862,4114 4869,4115 4876,4116 4883,4116 4899,4115 4906,4113 4913,4112 4919,4110 4924,4107 4930,4104 4934,4101 4939,4098 4943,4094 4949,4086 4955,4078 4959,4069 4962,4060 4964,4052 4966,4044 4967,4037 4967,4026 4967,4022 4966,1689 4966,1671 4970,1625 4976,1594 4984,1559 4997,1523 5015,1484 5039,1446 5069,1409 5106,1375 5151,1344 5205,1318 5269,1298 5343,1285 5429,1280 5514,1285 5588,1298 5653,1318 5707,1344 5753,1375 5790,1409 5821,1446 5845,1484 5863,1522 5877,1559 5886,1593 5892,1624 5896,1670 5896,1688 5896,4846 5897,4849 5898,4856 5902,4867 5904,4873 5907,4879 5911,4885 5916,4891 5921,4896 5928,4901 5935,4906 5939,4907 5944,4909 5948,4910 5953,4911 5958,4911 5964,4912 5966,4912 5967,4911 5971,4909 5979,4902 6001,4874 6061,4774 6215,4472 6419,4032 6431,4006 6446,3976 6469,3938 6501,3893 6542,3844 6593,3793 6656,3742 6730,3693 6818,3648 6919,3609 7035,3578 7166,3557 7313,3548 7478,3554 7661,3576 7661,3576 7662,3577 7662,3577 7663,3578 7663,3580 7660,3604 7656,3622 7628,3720 7580,3861 6480,6578 6457,6643 6379,6814 6316,6929 6235,7057 6134,7193 6013,7334 5869,7475 5701,7612 5508,7739 5288,7854 5039,7951 4761,8025 4451,8073 4109,8090 3682,8065 3311,7994 3145,7943 2992,7883 2851,7815 2721,7740 2494,7570 2307,7381 2156,7179 2038,6970 1948,6761 1883,6559 1838,6369 1810,6200 1789,5946 1788,5875 1788,5857 1788,5852 1788,5851 1788,5850 1788,5850 1788,5850 1788,2645 1789,2628 1794,2581 1800,2550 1809,2515 1822,2478 1840,2440 1862,2402 1891,2365 1926,2330 1968,2299 1992,2285 2018,2273 2046,2262 2076,2253 2144,2240 2221,2235 2294,2240 2327,2245 2357,2253 2386,2262 2412,2273 2437,2285 2459,2299 2499,2330 2532,2365 2559,2402 2580,2440 2597,2478 2609,2515 2618,2550 2624,2581 2629,2628 2630,2645 2633,4130 2633,4133 2634,4141 2635,4147 2637,4153 2639,4159 2643,4166 2647,4173 2652,4179 2658,4185 2666,4191 2676,4195 2686,4199 2699,4201 2714,4202 2727,4201 2733,4200 2739,4199 2744,4197 2749,4195 2753,4193 2757,4191 2760,4188 2764,4185 2769,4179 2773,4173 2777,4166 2779,4159 2781,4153 2782,4147 2782,4141 2782,4133 2782,4130 2787,1674 2786,1654 2790,1599 2795,1563 2804,1522 2817,1479 2835,1434 2858,1389 2888,1345 2926,1304 2972,1268 2998,1252 3026,1237 3057,1224 3091,1213 3127,1205 3166,1198 3252,1193 3340,1198 3379,1204 3416,1213 3450,1224 3482,1236 3511,1251 3538,1267 3584,1302 3622,1342 3653,1385 3677,1429 3695,1473 3708,1516 3717,1556 3722,1592 3726,1645 3726,1666 3726,3992 3726,3995 3727,4005 3729,4018 3731,4026 3734,4034 3738,4042 3743,4049 3749,4056 3756,4063 3760,4066 3764,4068 3769,4070 3774,4072 3780,4074 3786,4075 3792,4076 3799,4076 3807,4076 3813,4075 3820,4074 3826,4072 3831,4070 3836,4068 3841,4065 3845,4063 3849,4059 3852,4056 3858,4049 3863,4041 3867,4033 3869,4025 3871,4018 3873,4010 3873,4004 3874,3994 3874,3990 3878,1217 3878,1197 3882,1145 3887,1110 3896,1071 3909,1029 3927,986 3950,943 3980,901 4018,862 4064,827 4090,811 4118,797 4149,785 4183,775 4219,766 4258,760 4430,760Z" /> | ||
</vector> |
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
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,3 +1,6 @@ | ||
gptAssist ist ein WebView-Wrapper für ChatGPT. Die App blockiert alle URLs, die für die Funktion nicht essentiell sind. | ||
Login via Apple, Microsoft oder Google Konto werden nicht unterstützt. | ||
Bitte nutzen Sie für die Erstregistrierung einen Webbrowser. | ||
|
||
Sie können die Blockierung ein-/ausschalten, indem Sie auf die Schaltfläche oben rechts klicken. | ||
Wischen Sie ein wenig nach oben, um die Schaltfläche auszublenden. |
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,3 +1,6 @@ | ||
gptAssist is a simple WebView wrapper for ChatGPT. It blocks all URLs that are not essential for functioning. | ||
It does not support login via Apple, Microsoft, or Google account. | ||
Please use a web browser for initial sign up. | ||
|
||
You can switch on/off blocking by clicking the button at the top right. | ||
Swipe up a bit to hide the button. |
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,3 +1,6 @@ | ||
gptAssist, ChatGPT için basit bir WebView sarmalayıcıdır. Çalışması için gerekli olmayan tüm URL'leri engeller. | ||
Apple, Microsoft veya Google hesabı üzerinden giriş yapmayı desteklemez. | ||
Lütfen ilk kayıt için bir web tarayıcısı kullanın. | ||
Lütfen ilk kayıt için bir web tarayıcısı kullanın. | ||
|
||
Sağ üstteki butona tıklayarak engellemeyi açıp kapatabilirsiniz. | ||
Düğmeyi gizlemek için biraz yukarı kaydırın. |