Improve activity for bookmarks
This commit is contained in:
parent
0767a69af8
commit
d7574ebfc4
|
@ -16,8 +16,8 @@
|
|||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:installLocation="auto"
|
||||
package="app.fedilab.android">
|
||||
package="app.fedilab.android"
|
||||
android:installLocation="auto">
|
||||
|
||||
|
||||
<uses-feature
|
||||
|
@ -42,15 +42,15 @@
|
|||
<application
|
||||
android:name="app.fedilab.android.activities.MainApplication"
|
||||
android:allowBackup="false"
|
||||
tools:replace="android:allowBackup"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher_bubbles"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppThemeDark">
|
||||
android:theme="@style/AppThemeDark"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:allowBackup">
|
||||
|
||||
<service
|
||||
android:name="app.fedilab.android.services.LiveNotificationDelayedService"
|
||||
|
@ -102,10 +102,10 @@
|
|||
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/AppThemeDark_NoActionBar">
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
@ -136,9 +136,9 @@
|
|||
<!-- The app is a good candidate for URL in https://domain.name/@xxxxxx-->
|
||||
<!-- It should cover every URLs for statuses but some others not related to mastodon matching this scheme -->
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="*"
|
||||
android:pathPrefix="/@" />
|
||||
android:pathPrefix="/@"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
@ -157,10 +157,12 @@
|
|||
android:icon="@mipmap/ic_launcher_bubbles"
|
||||
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="bubbles" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="bubbles" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
@ -170,10 +172,12 @@
|
|||
android:icon="@mipmap/ic_launcher_fediverse"
|
||||
android:roundIcon="@mipmap/ic_launcher_fediverse_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="fediverse" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="fediverse" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
@ -183,10 +187,12 @@
|
|||
android:icon="@mipmap/ic_launcher_hero"
|
||||
android:roundIcon="@mipmap/ic_launcher_hero_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="hero" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="hero" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
@ -196,10 +202,12 @@
|
|||
android:icon="@mipmap/ic_launcher_atom"
|
||||
android:roundIcon="@mipmap/ic_launcher_atom_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="atom" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="atom" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
@ -209,10 +217,12 @@
|
|||
android:icon="@mipmap/ic_launcher_crash"
|
||||
android:roundIcon="@mipmap/ic_launcher_crash_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="braincrash" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="braincrash" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
@ -222,29 +232,31 @@
|
|||
android:icon="@mipmap/ic_launcher_mastalab"
|
||||
android:roundIcon="@mipmap/ic_launcher_mastalab_round"
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<meta-data android:name="icon" android:value="mastalab" />
|
||||
<meta-data
|
||||
android:name="icon"
|
||||
android:value="mastalab" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
|
||||
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.MastodonRegisterActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeRegisterActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.MastodonShareRegisterActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name">
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
@ -253,15 +265,15 @@
|
|||
|
||||
<data
|
||||
android:host="fedilab.app"
|
||||
android:scheme="https"
|
||||
android:pathPattern="/registration_helper/.*" />
|
||||
android:pathPattern="/registration_helper/.*"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.LoginActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name">
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
@ -275,229 +287,229 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ShowAccountActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.TootInfoActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.HashTagActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.WebviewConnectActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PlaylistsActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PhotoEditorActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
|
||||
android:theme="@style/Base.Theme.AppCompat" />
|
||||
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.WebviewActivity"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.SlideMediaActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TransparentDark"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:noHistory="true" />
|
||||
android:noHistory="true"
|
||||
android:theme="@style/TransparentDark" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.SearchResultActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.SearchResultTabActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ListActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.WhoToFollowActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ShowConversationActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerStatusActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerNotificationChartsActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerChartsActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerNotificationActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerChartsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OwnerNotificationActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.AboutActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.BookmarkActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.SettingsActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop" />
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.AdminActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.AccountReportActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ReorderTimelinesActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.OpencollectiveActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PartnerShipActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.InstanceActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PrivacyActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.TootActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:fitsSystemWindows="true"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:fitsSystemWindows="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark" />
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeDark"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PixelfedComposeActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:fitsSystemWindows="true"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:fitsSystemWindows="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark" />
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppThemeDark"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.EditProfileActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.CustomSharingActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.InstanceHealthActivity"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:excludeFromRecents="true" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ProxyActivity"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:excludeFromRecents="true" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ManageAccountsInListActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:excludeFromRecents="true" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.TagCacheActivity"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:excludeFromRecents="true" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeUploadActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.LiveNotificationSettingsAccountsActivity"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.MutedInstanceActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeEditUploadActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.GroupActivity"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"/>
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.CustomSharingActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.InstanceHealthActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ProxyActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.ManageAccountsInListActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.TagCacheActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeUploadActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.LiveNotificationSettingsAccountsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.MutedInstanceActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.PeertubeEditUploadActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="app.fedilab.android.activities.GroupActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
[
|
||||
{
|
||||
"theme_name":"Light",
|
||||
"base_theme":"LIGHT",
|
||||
"primary":"#FFFFFF",
|
||||
"primary_dark":"#FFFFFFFF",
|
||||
"primary_light":"#FFd9e1e8",
|
||||
"accent":"#FF2b90d9",
|
||||
"accent_dark":"#FF1b80c9",
|
||||
"accent_light":"#FF772b90d9",
|
||||
"background":"#FFFFFFFF",
|
||||
"background_dark":"#FFFFFFFF",
|
||||
"background_light":"#FFFFFFFF",
|
||||
"theme_name": "Light",
|
||||
"base_theme": "LIGHT",
|
||||
"primary": "#FFFFFF",
|
||||
"primary_dark": "#FFFFFFFF",
|
||||
"primary_light": "#FFd9e1e8",
|
||||
"accent": "#FF2b90d9",
|
||||
"accent_dark": "#FF1b80c9",
|
||||
"accent_light": "#FF772b90d9",
|
||||
"background": "#FFFFFFFF",
|
||||
"background_dark": "#FFFFFFFF",
|
||||
"background_light": "#FFFFFFFF",
|
||||
"should_tint_statusbar": true,
|
||||
"should_tint_navbar": true
|
||||
},
|
||||
{
|
||||
"theme_name":"Dark",
|
||||
"base_theme":"DARK",
|
||||
"primary":"#FF282c37",
|
||||
"primary_dark":"#FF282c37",
|
||||
"primary_light":"#FFd9e1e8",
|
||||
"accent":"#FF2b90d9",
|
||||
"accent_dark":"#FF1b80c9",
|
||||
"accent_light":"#FF772b90d9",
|
||||
"background":"#FF282c37",
|
||||
"background_dark":"#FF282c37",
|
||||
"background_light":"#FF282c37",
|
||||
"theme_name": "Dark",
|
||||
"base_theme": "DARK",
|
||||
"primary": "#FF282c37",
|
||||
"primary_dark": "#FF282c37",
|
||||
"primary_light": "#FFd9e1e8",
|
||||
"accent": "#FF2b90d9",
|
||||
"accent_dark": "#FF1b80c9",
|
||||
"accent_light": "#FF772b90d9",
|
||||
"background": "#FF282c37",
|
||||
"background_dark": "#FF282c37",
|
||||
"background_light": "#FF282c37",
|
||||
"should_tint_statusbar": true,
|
||||
"should_tint_navbar": true
|
||||
},
|
||||
{
|
||||
"theme_name":"Black",
|
||||
"base_theme":"DARK",
|
||||
"primary":"#FF000000",
|
||||
"primary_dark":"#FF000000",
|
||||
"primary_light":"#FF000000",
|
||||
"accent":"#FF606984",
|
||||
"accent_dark":"#FF606984",
|
||||
"accent_light":"#FF606984",
|
||||
"background":"#FF000000",
|
||||
"background_dark":"#FF000000",
|
||||
"background_light":"#FF000000",
|
||||
"theme_name": "Black",
|
||||
"base_theme": "DARK",
|
||||
"primary": "#FF000000",
|
||||
"primary_dark": "#FF000000",
|
||||
"primary_light": "#FF000000",
|
||||
"accent": "#FF606984",
|
||||
"accent_dark": "#FF606984",
|
||||
"accent_light": "#FF606984",
|
||||
"background": "#FF000000",
|
||||
"background_dark": "#FF000000",
|
||||
"background_light": "#FF000000",
|
||||
"should_tint_statusbar": true,
|
||||
"should_tint_navbar": true
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
|
@ -23,11 +22,6 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.UnderlineSpan;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -40,10 +34,17 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.BuildConfig;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Relationship;
|
||||
|
@ -51,13 +52,9 @@ import app.fedilab.android.client.Entities.Results;
|
|||
import app.fedilab.android.drawers.AccountSearchDevAdapter;
|
||||
import app.fedilab.android.helper.ExpandableHeightListView;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRelationshipInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,6 @@ package app.fedilab.android.activities;
|
|||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
@ -39,17 +38,12 @@ import androidx.viewpager.widget.ViewPager;
|
|||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.fragments.DisplayAdminAccountsFragment;
|
||||
import app.fedilab.android.fragments.DisplayAdminReportsFragment;
|
||||
import app.fedilab.android.fragments.DisplayStatusFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
import static app.fedilab.android.activities.BaseMainActivity.mPageReferenceMap;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas on 19/06/2019.
|
||||
|
|
|
@ -5,20 +5,16 @@ import android.app.ProgressDialog;
|
|||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.franmontiel.localechanger.LocaleChanger;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||
|
@ -39,13 +35,13 @@ public class BaseActivity extends CyaneaAppCompatActivity {
|
|||
|
||||
public static final int READ_WRITE_STORAGE = 52;
|
||||
public static Timer timer;
|
||||
private ProgressDialog mProgressDialog;
|
||||
|
||||
static {
|
||||
Helper.installProvider();
|
||||
EmojiManager.install(new EmojiOneProvider());
|
||||
}
|
||||
|
||||
private ProgressDialog mProgressDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -35,30 +35,6 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.util.Patterns;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -75,6 +51,28 @@ import android.widget.SeekBar;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -87,6 +85,17 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.regex.Matcher;
|
||||
|
||||
import app.fedilab.android.BuildConfig;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageFiltersAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveInstanceAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveMetaDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeInformationAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.SyncTimelinesAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoByIDAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Filters;
|
||||
|
@ -115,6 +124,13 @@ import app.fedilab.android.fragments.WhoToFollowFragment;
|
|||
import app.fedilab.android.helper.CrossActions;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.MenuFloating;
|
||||
import app.fedilab.android.interfaces.OnFilterActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveInstanceInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveMetaDataInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnSyncTimelineInterface;
|
||||
import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface;
|
||||
import app.fedilab.android.services.BackupStatusService;
|
||||
import app.fedilab.android.services.LiveNotificationDelayedService;
|
||||
import app.fedilab.android.services.LiveNotificationService;
|
||||
|
@ -124,24 +140,6 @@ import app.fedilab.android.sqlite.TempMuteDAO;
|
|||
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageFiltersAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveInstanceAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveMetaDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeInformationAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.asynctasks.SyncTimelinesAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoByIDAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnFilterActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveInstanceInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveMetaDataInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnSyncTimelineInterface;
|
||||
import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface;
|
||||
|
||||
import static app.fedilab.android.asynctasks.ManageFiltersAsyncTask.action.GET_ALL_FILTER;
|
||||
import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
||||
|
@ -151,51 +149,40 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
implements NavigationView.OnNavigationItemSelectedListener, OnUpdateAccountInfoInterface, OnRetrieveMetaDataInterface, OnRetrieveInstanceInterface, OnRetrieveRemoteAccountInterface, OnRetrieveEmojiAccountInterface, OnFilterActionInterface, OnSyncTimelineInterface {
|
||||
|
||||
|
||||
public static String currentLocale;
|
||||
public static List<Filters> filters = new ArrayList<>();
|
||||
public static int countNewStatus;
|
||||
public static int countNewNotifications;
|
||||
public static String lastHomeId = null, lastNotificationId = null;
|
||||
public static String displayPeertube = null;
|
||||
public static UpdateAccountInfoAsyncTask.SOCIAL social;
|
||||
public static List<ManageTimelines> timelines;
|
||||
public static HashMap<Integer, Fragment> mPageReferenceMap;
|
||||
public static HashMap<String, Integer> poll_limits = new HashMap<>();
|
||||
public static List<String> mutedAccount = new ArrayList<>();
|
||||
public static String regex_home, regex_local, regex_public;
|
||||
public static boolean show_boosts, show_replies, show_art_nsfw;
|
||||
public static iconLauncher mLauncher = iconLauncher.BUBBLES;
|
||||
private static boolean notificationChecked = false;
|
||||
private final int PICK_IMPORT = 5556;
|
||||
private FloatingActionButton toot, delete_all, add_new;
|
||||
private HashMap<String, String> tagTile = new HashMap<>();
|
||||
private HashMap<String, Integer> tagItem = new HashMap<>();
|
||||
private TextView toolbarTitle;
|
||||
private SearchView toolbar_search;
|
||||
private View headerLayout;
|
||||
public static String currentLocale;
|
||||
private TabLayout tabLayout;
|
||||
private ViewPager viewPager;
|
||||
private RelativeLayout main_app_container;
|
||||
public static List<Filters> filters = new ArrayList<>();
|
||||
public static int countNewStatus;
|
||||
public static int countNewNotifications;
|
||||
public static String lastHomeId = null, lastNotificationId = null;
|
||||
private AppBarLayout appBar;
|
||||
private String userId;
|
||||
private String instance;
|
||||
private PagerAdapter adapter;
|
||||
private ImageView delete_instance, display_timeline;
|
||||
public static String displayPeertube = null;
|
||||
private int style;
|
||||
private Activity activity;
|
||||
public static UpdateAccountInfoAsyncTask.SOCIAL social;
|
||||
private final int PICK_IMPORT = 5556;
|
||||
public static List<ManageTimelines> timelines;
|
||||
private BroadcastReceiver hidde_menu, update_topbar;
|
||||
|
||||
public static HashMap<Integer, Fragment> mPageReferenceMap;
|
||||
private static boolean notificationChecked = false;
|
||||
public static HashMap<String, Integer> poll_limits = new HashMap<>();
|
||||
private Instance instanceClass;
|
||||
public static List<String> mutedAccount = new ArrayList<>();
|
||||
public static String regex_home, regex_local, regex_public;
|
||||
public static boolean show_boosts, show_replies, show_art_nsfw;
|
||||
|
||||
public enum iconLauncher{
|
||||
BUBBLES,
|
||||
FEDIVERSE,
|
||||
HERO,
|
||||
ATOM,
|
||||
BRAINCRASH,
|
||||
MASTALAB
|
||||
}
|
||||
public static iconLauncher mLauncher = iconLauncher.BUBBLES;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -262,7 +249,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
countNewNotifications = 0;
|
||||
|
||||
//TODO: remove that line
|
||||
// social = UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED;
|
||||
// social = UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED;
|
||||
|
||||
regex_home = sharedpreferences.getString(Helper.SET_FILTER_REGEX_HOME, null);
|
||||
regex_local = sharedpreferences.getString(Helper.SET_FILTER_REGEX_LOCAL, null);
|
||||
|
@ -447,7 +434,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
iconSub.setImageResource(R.drawable.ic_subscriptions);
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconOver = pTabOver.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconOver.setImageResource(R.drawable.ic_overview);
|
||||
|
@ -600,10 +586,10 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
if (tab.getCustomView() != null) {
|
||||
if (viewPager.getAdapter() != null) {
|
||||
Fragment fragment = (Fragment) viewPager.getAdapter().instantiateItem(viewPager, tab.getPosition());
|
||||
if( fragment instanceof DisplayStatusFragment) {
|
||||
if (fragment instanceof DisplayStatusFragment) {
|
||||
DisplayStatusFragment displayStatusFragment = ((DisplayStatusFragment) fragment);
|
||||
displayStatusFragment.scrollToTop();
|
||||
}else if(fragment instanceof DisplayNotificationsFragment){
|
||||
} else if (fragment instanceof DisplayNotificationsFragment) {
|
||||
DisplayNotificationsFragment displayNotificationsFragment = ((DisplayNotificationsFragment) fragment);
|
||||
displayNotificationsFragment.scrollToTop();
|
||||
}
|
||||
|
@ -690,7 +676,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
int position = 0;
|
||||
if (tabLayout != null)
|
||||
position = tabLayout.getSelectedTabPosition();
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, true,BaseMainActivity.this).execute();
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, true, BaseMainActivity.this).execute();
|
||||
}
|
||||
};
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(hidde_menu, new IntentFilter(Helper.RECEIVE_HIDE_ITEM));
|
||||
|
@ -710,8 +696,8 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
//Peertube search
|
||||
if (tabLayout != null && timelines != null && timelines.size() > tabLayout.getSelectedTabPosition() &&
|
||||
(timelines.get(tabLayout.getSelectedTabPosition()).getType() == ManageTimelines.Type.PEERTUBE ||
|
||||
(timelines.get(tabLayout.getSelectedTabPosition()).getRemoteInstance() != null &&
|
||||
timelines.get(tabLayout.getSelectedTabPosition()).getRemoteInstance().getType().equals("PEERTUBE")))) {
|
||||
(timelines.get(tabLayout.getSelectedTabPosition()).getRemoteInstance() != null &&
|
||||
timelines.get(tabLayout.getSelectedTabPosition()).getRemoteInstance().getType().equals("PEERTUBE")))) {
|
||||
DisplayStatusFragment statusFragment;
|
||||
Bundle bundle = new Bundle();
|
||||
statusFragment = new DisplayStatusFragment();
|
||||
|
@ -873,7 +859,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
tabLayout.getTabAt(0).select();
|
||||
*/
|
||||
if (social != UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
||||
if( social != UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
|
||||
if (social != UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
|
||||
toot.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
@ -888,7 +874,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
return false;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
toot.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
@ -1207,10 +1193,10 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
final MaterialSpinner set_live_type = dialogView.findViewById(R.id.set_live_type);
|
||||
String[] labels = {getString(R.string.live_notif), getString(R.string.live_delayed), getString(R.string.no_live_notif)};
|
||||
ArrayAdapter<String> adapterLive = new ArrayAdapter<>(getApplicationContext(),
|
||||
android.R.layout.simple_spinner_dropdown_item,labels );
|
||||
android.R.layout.simple_spinner_dropdown_item, labels);
|
||||
set_live_type.setAdapter(adapterLive);
|
||||
TextView set_live_type_indication = dialogView.findViewById(R.id.set_live_type_indication);
|
||||
switch (Helper.liveNotifType(getApplicationContext())){
|
||||
switch (Helper.liveNotifType(getApplicationContext())) {
|
||||
case Helper.NOTIF_LIVE:
|
||||
set_live_type_indication.setText(R.string.live_notif_indication);
|
||||
break;
|
||||
|
@ -1247,7 +1233,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
editor.apply();
|
||||
break;
|
||||
}
|
||||
switch (Helper.liveNotifType(getApplicationContext())){
|
||||
switch (Helper.liveNotifType(getApplicationContext())) {
|
||||
case Helper.NOTIF_LIVE:
|
||||
set_live_type_indication.setText(R.string.live_notif_indication);
|
||||
break;
|
||||
|
@ -1262,7 +1248,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
});
|
||||
|
||||
|
||||
|
||||
dialogBuilderOptin.setTitle(R.string.settings_popup_title);
|
||||
dialogBuilderOptin.setCancelable(false);
|
||||
dialogBuilderOptin.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
||||
|
@ -1277,7 +1262,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
dialogBuilderOptin.show();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
;
|
||||
|
||||
}
|
||||
Helper.switchLayout(BaseMainActivity.this);
|
||||
|
@ -1327,7 +1311,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
|
||||
protected abstract void rateThisApp();
|
||||
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
@ -1421,13 +1404,13 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.REDRAW_MENU) {
|
||||
Helper.hideMenuItem(BaseMainActivity.this, navigationView.getMenu());
|
||||
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.SEARCH_TAG) {
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, -1, false,BaseMainActivity.this).execute();
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, -1, false, BaseMainActivity.this).execute();
|
||||
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.REFRESH_TIMELINE) {
|
||||
int position = 0;
|
||||
boolean refreshList = extras.getBoolean(Helper.REFRESH_LIST_TIMELINE, false);
|
||||
if (tabLayout != null)
|
||||
position = tabLayout.getSelectedTabPosition();
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, refreshList,BaseMainActivity.this).execute();
|
||||
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, refreshList, BaseMainActivity.this).execute();
|
||||
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.SEARCH_REMOTE) {
|
||||
String url = extras.getString(Helper.SEARCH_URL);
|
||||
intent.replaceExtras(new Bundle());
|
||||
|
@ -1610,7 +1593,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("isMainActivityRunning", true).apply();
|
||||
|
||||
|
||||
//Proceeds to update of the authenticated account
|
||||
/*if (Helper.isLoggedIn(getApplicationContext())) {
|
||||
new UpdateAccountInfoByIDAsyncTask(getApplicationContext(), social, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
|
@ -1637,7 +1620,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
@ -1729,7 +1711,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
Intent intent = new Intent(getApplicationContext(), MutedInstanceActivity.class);
|
||||
startActivity(intent);
|
||||
return false;
|
||||
}else if ( id == R.id.nav_bookmarks){
|
||||
} else if (id == R.id.nav_bookmarks) {
|
||||
Intent intent = new Intent(getApplicationContext(), BookmarkActivity.class);
|
||||
startActivity(intent);
|
||||
return false;
|
||||
|
@ -1784,7 +1766,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
toot.hide();
|
||||
statusFragment = new DisplayStatusFragment();
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.FAVOURITES);
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED){
|
||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
|
||||
bundle.putString("instanceType", "PIXELFED");
|
||||
}
|
||||
statusFragment.setArguments(bundle);
|
||||
|
@ -1844,7 +1826,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
fragmentTag = "HOW_TO_VIDEOS";
|
||||
fragmentManager.beginTransaction()
|
||||
.replace(R.id.main_app_container, displayHowToFragment, fragmentTag).commit();
|
||||
} else if (id == R.id.nav_muted ) {
|
||||
} else if (id == R.id.nav_muted) {
|
||||
toot.hide();
|
||||
accountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.MUTED);
|
||||
|
@ -1870,7 +1852,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
fragmentManager.beginTransaction()
|
||||
.replace(R.id.main_app_container, displayBookmarksPixelfedFragment, fragmentTag).commit();
|
||||
toot.hide();
|
||||
}else if (id == R.id.nav_peertube) {
|
||||
} else if (id == R.id.nav_peertube) {
|
||||
DisplayFavoritesPeertubeFragment displayFavoritesPeertubeFragment = new DisplayFavoritesPeertubeFragment();
|
||||
fragmentTag = "BOOKMARKS_PEERTUBE";
|
||||
fragmentManager.beginTransaction()
|
||||
|
@ -1922,7 +1904,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void populateTitleWithTag(String tag, String title, int index) {
|
||||
if (tag == null)
|
||||
return;
|
||||
|
@ -1970,7 +1951,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRetrieveMetaData(boolean error, String sharedSubject, String sharedText, String image, String title, String description) {
|
||||
Bundle b = new Bundle();
|
||||
|
@ -2036,7 +2016,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void displayTimelineMoreButton(boolean displayed) {
|
||||
if (displayed) {
|
||||
display_timeline.setVisibility(View.VISIBLE);
|
||||
|
@ -2061,7 +2040,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
if (position < 0)
|
||||
position = 0;
|
||||
if (toolbarTitle != null)
|
||||
viewPager.setOffscreenPageLimit(2);
|
||||
viewPager.setOffscreenPageLimit(2);
|
||||
main_app_container = findViewById(R.id.main_app_container);
|
||||
|
||||
boolean iconOnly = true;
|
||||
|
@ -2207,6 +2186,127 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
|
||||
public void updateHomeCounter() {
|
||||
int i = 0;
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
int tootperpage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);
|
||||
if (timelines != null && timelines.size() > 0) {
|
||||
for (ManageTimelines tl : timelines) {
|
||||
if (tl.getType() == ManageTimelines.Type.HOME) {
|
||||
if (tabLayout.getTabCount() > i) {
|
||||
View tabHome = tabLayout.getTabAt(i).getCustomView();
|
||||
if (tabHome != null) {
|
||||
TextView tabCounterHome = tabHome.findViewById(R.id.tab_counter);
|
||||
if (countNewStatus == tootperpage) {
|
||||
tabCounterHome.setText(String.format(Locale.getDefault(), "%d+", countNewStatus));
|
||||
} else {
|
||||
tabCounterHome.setText(String.valueOf(countNewStatus));
|
||||
}
|
||||
if (countNewStatus > 0) {
|
||||
//New data are available
|
||||
//The fragment is not displayed, so the counter is displayed
|
||||
tabCounterHome.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCounterHome.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void manageTab(RetrieveFeedsAsyncTask.Type type, int value) {
|
||||
SQLiteDatabase db = Sqlite.getInstance(BaseMainActivity.this, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
List<ManageTimelines> tls = new TimelinesDAO(BaseMainActivity.this, db).getDisplayedTimelines();
|
||||
for (ManageTimelines tl : tls) {
|
||||
if (type == ManageTimelines.transform(BaseMainActivity.this, tl.getType())) {
|
||||
View tabCustom = tabLayout.getTabAt(tl.getPosition()).getCustomView();
|
||||
assert tabCustom != null;
|
||||
TextView tabCountertCustom = tabCustom.findViewById(R.id.tab_counter);
|
||||
tabCountertCustom.setText(String.valueOf(value));
|
||||
if (value > 0) {
|
||||
tabCountertCustom.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCountertCustom.setVisibility(View.GONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateNotifCounter() {
|
||||
if (timelines == null)
|
||||
return;
|
||||
int i = 0;
|
||||
int position = -1;
|
||||
for (ManageTimelines tl : timelines) {
|
||||
if (tl.getType() == ManageTimelines.Type.NOTIFICATION) {
|
||||
if (tabLayout.getTabAt(i) != null) {
|
||||
position = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (position == -1)
|
||||
return;
|
||||
View tabNotif = tabLayout.getTabAt(position).getCustomView();
|
||||
if (tabNotif == null)
|
||||
return;
|
||||
TextView tabCounterNotif = tabNotif.findViewById(R.id.tab_counter);
|
||||
if (tabCounterNotif == null)
|
||||
return;
|
||||
if (countNewNotifications == Helper.NOTIFICATIONS_PER_PAGE) {
|
||||
tabCounterNotif.setText(String.format(Locale.getDefault(), "%d+", countNewNotifications));
|
||||
} else {
|
||||
tabCounterNotif.setText(String.valueOf(countNewNotifications));
|
||||
}
|
||||
if (countNewNotifications > 0) {
|
||||
tabCounterNotif.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCounterNotif.setVisibility(View.GONE);
|
||||
}
|
||||
try {
|
||||
TabLayoutNotificationsFragment tabLayoutNotificationsFragment = (TabLayoutNotificationsFragment) mPageReferenceMap.get(position);
|
||||
ViewPager notifViewPager = tabLayoutNotificationsFragment.getViewPager();
|
||||
|
||||
if (notifViewPager != null && notifViewPager.getAdapter() != null) {
|
||||
DisplayNotificationsFragment displayNotificationsFragment = (DisplayNotificationsFragment) notifViewPager.getAdapter().instantiateItem(notifViewPager, 0);
|
||||
displayNotificationsFragment.updateNotificationRead();
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void manageFloatingButton(boolean display) {
|
||||
if (display) {
|
||||
tootShow();
|
||||
} else {
|
||||
toot.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public void tootShow() {
|
||||
toot.show();
|
||||
}
|
||||
|
||||
public boolean getFloatingVisibility() {
|
||||
return toot.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public enum iconLauncher {
|
||||
BUBBLES,
|
||||
FEDIVERSE,
|
||||
HERO,
|
||||
ATOM,
|
||||
BRAINCRASH,
|
||||
MASTALAB
|
||||
}
|
||||
|
||||
/**
|
||||
* Page Adapter for Mastodon & Peertube & PixelFed
|
||||
*/
|
||||
|
@ -2362,119 +2462,4 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
|
||||
|
||||
public void updateHomeCounter() {
|
||||
int i = 0;
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
int tootperpage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);
|
||||
if (timelines != null && timelines.size() > 0) {
|
||||
for (ManageTimelines tl : timelines) {
|
||||
if (tl.getType() == ManageTimelines.Type.HOME) {
|
||||
if (tabLayout.getTabCount() > i) {
|
||||
View tabHome = tabLayout.getTabAt(i).getCustomView();
|
||||
if (tabHome != null) {
|
||||
TextView tabCounterHome = tabHome.findViewById(R.id.tab_counter);
|
||||
if (countNewStatus == tootperpage) {
|
||||
tabCounterHome.setText(String.format(Locale.getDefault(), "%d+", countNewStatus));
|
||||
} else {
|
||||
tabCounterHome.setText(String.valueOf(countNewStatus));
|
||||
}
|
||||
if (countNewStatus > 0) {
|
||||
//New data are available
|
||||
//The fragment is not displayed, so the counter is displayed
|
||||
tabCounterHome.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCounterHome.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void manageTab(RetrieveFeedsAsyncTask.Type type, int value) {
|
||||
SQLiteDatabase db = Sqlite.getInstance(BaseMainActivity.this, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
List<ManageTimelines> tls = new TimelinesDAO(BaseMainActivity.this, db).getDisplayedTimelines();
|
||||
for (ManageTimelines tl : tls) {
|
||||
if (type == ManageTimelines.transform(BaseMainActivity.this, tl.getType())) {
|
||||
View tabCustom = tabLayout.getTabAt(tl.getPosition()).getCustomView();
|
||||
assert tabCustom != null;
|
||||
TextView tabCountertCustom = tabCustom.findViewById(R.id.tab_counter);
|
||||
tabCountertCustom.setText(String.valueOf(value));
|
||||
if (value > 0) {
|
||||
tabCountertCustom.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCountertCustom.setVisibility(View.GONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateNotifCounter() {
|
||||
if (timelines == null)
|
||||
return;
|
||||
int i = 0;
|
||||
int position = -1;
|
||||
for (ManageTimelines tl : timelines) {
|
||||
if (tl.getType() == ManageTimelines.Type.NOTIFICATION) {
|
||||
if (tabLayout.getTabAt(i) != null) {
|
||||
position = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (position == -1)
|
||||
return;
|
||||
View tabNotif = tabLayout.getTabAt(position).getCustomView();
|
||||
if (tabNotif == null)
|
||||
return;
|
||||
TextView tabCounterNotif = tabNotif.findViewById(R.id.tab_counter);
|
||||
if (tabCounterNotif == null)
|
||||
return;
|
||||
if (countNewNotifications == Helper.NOTIFICATIONS_PER_PAGE) {
|
||||
tabCounterNotif.setText(String.format(Locale.getDefault(), "%d+", countNewNotifications));
|
||||
} else {
|
||||
tabCounterNotif.setText(String.valueOf(countNewNotifications));
|
||||
}
|
||||
if (countNewNotifications > 0) {
|
||||
tabCounterNotif.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
tabCounterNotif.setVisibility(View.GONE);
|
||||
}
|
||||
try {
|
||||
TabLayoutNotificationsFragment tabLayoutNotificationsFragment = (TabLayoutNotificationsFragment) mPageReferenceMap.get(position);
|
||||
ViewPager notifViewPager = tabLayoutNotificationsFragment.getViewPager();
|
||||
|
||||
if (notifViewPager != null && notifViewPager.getAdapter() != null) {
|
||||
DisplayNotificationsFragment displayNotificationsFragment = (DisplayNotificationsFragment) notifViewPager.getAdapter().instantiateItem(notifViewPager, 0);
|
||||
displayNotificationsFragment.updateNotificationRead();
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void manageFloatingButton(boolean display) {
|
||||
if (display) {
|
||||
tootShow();
|
||||
} else {
|
||||
toot.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public void tootShow() {
|
||||
toot.show();
|
||||
}
|
||||
|
||||
|
||||
public boolean getFloatingVisibility() {
|
||||
return toot.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -30,7 +30,6 @@ import android.widget.LinearLayout;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
@ -44,7 +43,6 @@ import org.jetbrains.annotations.NotNull;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
|
@ -156,7 +154,7 @@ public class BookmarkActivity extends BaseActivity implements OnRetrieveFeedsInt
|
|||
@Override
|
||||
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.bookmarks, menu);
|
||||
if( MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.MASTODON && MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA){
|
||||
if (MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.MASTODON && MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
menu.findItem(R.id.action_export_bookmarks).setVisible(false);
|
||||
menu.findItem(R.id.action_import_bookmarks).setVisible(false);
|
||||
}
|
||||
|
@ -221,7 +219,7 @@ public class BookmarkActivity extends BaseActivity implements OnRetrieveFeedsInt
|
|||
|
||||
@Override
|
||||
public void onRetrieveBookmarks(List<Status> bookmarks) {
|
||||
if( bookmarks != null) {
|
||||
if (bookmarks != null) {
|
||||
statuses = new ArrayList<>();
|
||||
statuses.clear();
|
||||
statuses.addAll(bookmarks);
|
||||
|
@ -229,7 +227,7 @@ public class BookmarkActivity extends BaseActivity implements OnRetrieveFeedsInt
|
|||
statusListAdapter = new StatusListAdapter(RetrieveFeedsAsyncTask.Type.CACHE_BOOKMARKS, null, isOnWifi, statuses);
|
||||
lv_status.setAdapter(statusListAdapter);
|
||||
statusListAdapter.notifyDataSetChanged();
|
||||
if( statuses.size() == 0 ) {
|
||||
if (statuses.size() == 0) {
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
|
@ -23,11 +22,6 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -41,22 +35,25 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.CustomSharingAsyncTask;
|
||||
import app.fedilab.android.client.CustomSharingResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Attachment;
|
||||
import app.fedilab.android.client.Entities.Emojis;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnCustomSharingInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.CustomSharingAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnCustomSharingInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -31,14 +30,6 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.Html;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -54,6 +45,12 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
|
@ -64,21 +61,21 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountInfoAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateCredentialAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Version;
|
||||
import app.fedilab.android.client.Glide.GlideApp;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnUpdateCredentialInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountInfoAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateCredentialAsyncTask;
|
||||
import app.fedilab.android.client.Glide.GlideApp;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnUpdateCredentialInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -89,22 +86,22 @@ import app.fedilab.android.interfaces.OnUpdateCredentialInterface;
|
|||
public class EditProfileActivity extends BaseActivity implements OnRetrieveAccountInterface, OnUpdateCredentialInterface {
|
||||
|
||||
|
||||
private static final int PICK_IMAGE_HEADER = 4565;
|
||||
private static final int PICK_IMAGE_PROFILE = 6545;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE_HEADER = 754;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE_PICTURE = 755;
|
||||
private EditText set_profile_name, set_profile_description;
|
||||
private LinearLayout custom_fields_container;
|
||||
private ImageView set_profile_picture, set_header_picture;
|
||||
private Button set_change_profile_picture, set_change_header_picture, set_profile_save;
|
||||
private TextView set_header_picture_overlay;
|
||||
private CheckBox set_lock_account, set_sensitive_content;
|
||||
private static final int PICK_IMAGE_HEADER = 4565;
|
||||
private static final int PICK_IMAGE_PROFILE = 6545;
|
||||
private String profile_username, profile_note;
|
||||
private ByteArrayInputStream profile_picture, header_picture;
|
||||
private API.accountPrivacy profile_privacy;
|
||||
private boolean sensitive;
|
||||
private Bitmap profile_picture_bmp, profile_header_bmp;
|
||||
private ImageView pp_actionBar;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE_HEADER = 754;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE_PICTURE = 755;
|
||||
private String avatarName, headerName;
|
||||
|
||||
@Override
|
||||
|
@ -155,7 +152,6 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
|
|||
Account account = new AccountDAO(getApplicationContext(), db).getUniqAccount(userId, instance);
|
||||
|
||||
|
||||
|
||||
Helper.loadGiF(getApplicationContext(), account.getAvatar(), pp_actionBar);
|
||||
custom_fields_container = findViewById(R.id.custom_fields_container);
|
||||
set_profile_name = findViewById(R.id.set_profile_name);
|
||||
|
@ -179,7 +175,7 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
|
|||
set_sensitive_content.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(account.getSocial().toUpperCase().equals("MASTODON")){
|
||||
if (account.getSocial().toUpperCase().equals("MASTODON")) {
|
||||
custom_fields_container.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -501,7 +497,7 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
|
|||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode,
|
||||
@NonNull String permissions[], @NonNull int[] grantResults) {
|
||||
@NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
switch (requestCode) {
|
||||
case MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE_HEADER: {
|
||||
// If request is cancelled, the result arrays are empty.
|
||||
|
|
|
@ -24,7 +24,6 @@ import android.view.View;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
@ -35,7 +34,6 @@ import org.jetbrains.annotations.NotNull;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
|
|
|
@ -20,35 +20,32 @@ import android.content.SharedPreferences;
|
|||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.drawers.StatusListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
import app.fedilab.android.sqlite.SearchDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -174,7 +171,7 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
|
|||
|
||||
SQLiteDatabase db = Sqlite.getInstance(HashTagActivity.this, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
List<String> searchInDb = new SearchDAO(HashTagActivity.this, db).getSearchByKeyword(tag.trim());
|
||||
if ( searchInDb != null && searchInDb.size() > 0) {
|
||||
if (searchInDb != null && searchInDb.size() > 0) {
|
||||
menu.findItem(R.id.action_pin).setVisible(false);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -24,13 +23,6 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -42,15 +34,18 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveInstanceAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Instance;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveInstanceAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveInstanceInterface;
|
||||
|
||||
import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,47 +18,32 @@ package app.fedilab.android.activities;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.UnderlineSpan;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.InstanceSocial;
|
||||
import app.fedilab.android.client.HttpsConnection;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.R;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,15 +19,6 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.text.InputFilter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -40,18 +31,26 @@ import android.widget.LinearLayout;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.drawers.StatusListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -62,6 +61,7 @@ import app.fedilab.android.interfaces.OnListActionInterface;
|
|||
public class ListActivity extends BaseActivity implements OnListActionInterface {
|
||||
|
||||
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private String title, listId;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
|
@ -71,8 +71,6 @@ public class ListActivity extends BaseActivity implements OnListActionInterface
|
|||
private boolean firstLoad;
|
||||
private boolean flag_loading;
|
||||
private StatusListAdapter statusListAdapter;
|
||||
LinearLayoutManager mLayoutManager;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -20,9 +20,7 @@ import android.database.sqlite.SQLiteDatabase;
|
|||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -45,7 +43,6 @@ import app.fedilab.android.sqlite.Sqlite;
|
|||
public class LiveNotificationSettingsAccountsActivity extends BaseActivity {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -26,17 +25,7 @@ import android.graphics.Color;
|
|||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
|
@ -60,15 +49,19 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.elconfidencial.bubbleshowcase.BubbleShowCase;
|
||||
import com.elconfidencial.bubbleshowcase.BubbleShowCaseBuilder;
|
||||
import com.elconfidencial.bubbleshowcase.BubbleShowCaseListener;
|
||||
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
|
@ -76,6 +69,8 @@ import java.net.URL;
|
|||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.InstanceNodeInfo;
|
||||
|
@ -85,10 +80,6 @@ import app.fedilab.android.helper.Helper;
|
|||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
|
||||
import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -98,14 +89,16 @@ import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
|||
|
||||
public class LoginActivity extends BaseActivity {
|
||||
|
||||
public static boolean admin;
|
||||
private static String client_id;
|
||||
private static String client_secret;
|
||||
private static boolean client_id_for_webview = false;
|
||||
private static String instance;
|
||||
private final int PICK_IMPORT = 5557;
|
||||
boolean isLoadingInstance = false;
|
||||
private AutoCompleteTextView login_instance;
|
||||
private EditText login_uid;
|
||||
private EditText login_passwd;
|
||||
boolean isLoadingInstance = false;
|
||||
private String oldSearch;
|
||||
private Button connectionButton, connect_button;
|
||||
private String actionToken;
|
||||
|
@ -117,8 +110,18 @@ public class LoginActivity extends BaseActivity {
|
|||
private LinearLayout step_login_credential, step_instance;
|
||||
private TextView instance_chosen;
|
||||
private ImageView info_instance;
|
||||
private final int PICK_IMPORT = 5557;
|
||||
public static boolean admin;
|
||||
|
||||
public static String redirectUserToAuthorizeAndLogin(Context context, UpdateAccountInfoAsyncTask.SOCIAL socialNetwork, String clientId, String instance) {
|
||||
String queryString = Helper.CLIENT_ID + "=" + clientId;
|
||||
queryString += "&" + Helper.REDIRECT_URI + "=" + Uri.encode(Helper.REDIRECT_CONTENT_WEB);
|
||||
queryString += "&" + Helper.RESPONSE_TYPE + "=code";
|
||||
if (admin) {
|
||||
queryString += "&" + Helper.SCOPE + "=" + Helper.OAUTH_SCOPES_ADMIN;
|
||||
} else {
|
||||
queryString += "&" + Helper.SCOPE + "=" + Helper.OAUTH_SCOPES;
|
||||
}
|
||||
return Helper.instanceWithProtocol(context, instance) + Helper.EP_AUTHORIZE + "?" + queryString;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -129,7 +132,7 @@ public class LoginActivity extends BaseActivity {
|
|||
if (b != null) {
|
||||
autofilledInstance = b.getString("instance", null);
|
||||
social = b.getString("social", null);
|
||||
if( instanceNodeInfo != null) {
|
||||
if (instanceNodeInfo != null) {
|
||||
socialNetwork = Helper.setSoftware(instanceNodeInfo.getName(), false);
|
||||
}
|
||||
admin = b.getBoolean("admin", false);
|
||||
|
@ -137,7 +140,7 @@ public class LoginActivity extends BaseActivity {
|
|||
|
||||
if (getIntent() != null && getIntent().getData() != null && getIntent().getData().toString().contains("mastalab://backtomastalab?code=")) {
|
||||
String url = getIntent().getData().toString();
|
||||
String val[] = url.split("code=");
|
||||
String[] val = url.split("code=");
|
||||
String code = val[1];
|
||||
final String action = "/oauth/token";
|
||||
final HashMap<String, String> parameters = new HashMap<>();
|
||||
|
@ -224,7 +227,6 @@ public class LoginActivity extends BaseActivity {
|
|||
});
|
||||
|
||||
|
||||
|
||||
content_create = new SpannableString(getString(R.string.join_peertube));
|
||||
content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0);
|
||||
content_create.setSpan(new ForegroundColorSpan(ContextCompat.getColor(LoginActivity.this, R.color.cyanea_accent_reference)), 0, content_create.length(),
|
||||
|
@ -279,7 +281,7 @@ public class LoginActivity extends BaseActivity {
|
|||
if (instanceNodeInfo != null && instanceNodeInfo.getName() != null) {
|
||||
socialNetwork = Helper.setSoftware(instanceNodeInfo.getName(), false);
|
||||
|
||||
if (instanceNodeInfo.getName().equals("PLEROMA") ||instanceNodeInfo.getName().equals("MASTODON") || instanceNodeInfo.getName().equals("PIXELFED")) {
|
||||
if (instanceNodeInfo.getName().equals("PLEROMA") || instanceNodeInfo.getName().equals("MASTODON") || instanceNodeInfo.getName().equals("PIXELFED")) {
|
||||
client_id_for_webview = true;
|
||||
retrievesClientId();
|
||||
} else {
|
||||
|
@ -527,18 +529,18 @@ public class LoginActivity extends BaseActivity {
|
|||
|
||||
String message;
|
||||
if (e.getLocalizedMessage() != null && e.getLocalizedMessage().trim().length() > 0) {
|
||||
if(e.getLocalizedMessage().length() < 100) {
|
||||
if (e.getLocalizedMessage().length() < 100) {
|
||||
message = e.getLocalizedMessage();
|
||||
}else{
|
||||
message = getString(R.string.long_api_error,"\ud83d\ude05");
|
||||
} else {
|
||||
message = getString(R.string.long_api_error, "\ud83d\ude05");
|
||||
}
|
||||
}else if (e.getMessage() != null && e.getMessage().trim().length() > 0) {
|
||||
if(e.getLocalizedMessage().length() < 100) {
|
||||
} else if (e.getMessage() != null && e.getMessage().trim().length() > 0) {
|
||||
if (e.getLocalizedMessage().length() < 100) {
|
||||
message = e.getMessage();
|
||||
}else{
|
||||
message = getString(R.string.long_api_error,"\ud83d\ude05");
|
||||
} else {
|
||||
message = getString(R.string.long_api_error, "\ud83d\ude05");
|
||||
}
|
||||
}else
|
||||
} else
|
||||
message = getString(R.string.client_error);
|
||||
Toasty.error(getApplicationContext(), message, Toast.LENGTH_LONG).show();
|
||||
|
||||
|
@ -695,7 +697,6 @@ public class LoginActivity extends BaseActivity {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
private void manageClient(String client_id, String client_secret, String id) {
|
||||
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
|
@ -788,7 +789,6 @@ public class LoginActivity extends BaseActivity {
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode,
|
||||
Intent data) {
|
||||
|
@ -805,20 +805,6 @@ public class LoginActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static String redirectUserToAuthorizeAndLogin(Context context, UpdateAccountInfoAsyncTask.SOCIAL socialNetwork, String clientId, String instance) {
|
||||
String queryString = Helper.CLIENT_ID + "=" + clientId;
|
||||
queryString += "&" + Helper.REDIRECT_URI + "=" + Uri.encode(Helper.REDIRECT_CONTENT_WEB);
|
||||
queryString += "&" + Helper.RESPONSE_TYPE + "=code";
|
||||
if (admin) {
|
||||
queryString += "&" + Helper.SCOPE + "=" + Helper.OAUTH_SCOPES_ADMIN;
|
||||
} else {
|
||||
queryString += "&" + Helper.SCOPE + "=" + Helper.OAUTH_SCOPES;
|
||||
}
|
||||
return Helper.instanceWithProtocol(context, instance) + Helper.EP_AUTHORIZE + "?" + queryString;
|
||||
}
|
||||
|
||||
|
||||
private void showcaseInstance(final boolean loop) {
|
||||
BubbleShowCaseBuilder showCaseBuilder = new BubbleShowCaseBuilder(LoginActivity.this)
|
||||
.title(getString(R.string.instance))
|
||||
|
|
|
@ -42,14 +42,14 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import app.fedilab.android.BuildConfig;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.jobs.ApplicationJob;
|
||||
import app.fedilab.android.jobs.BackupNotificationsSyncJob;
|
||||
import app.fedilab.android.jobs.BackupStatusesSyncJob;
|
||||
import app.fedilab.android.jobs.NotificationsSyncJob;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.BuildConfig;
|
||||
import app.fedilab.android.R;
|
||||
|
||||
import static app.fedilab.android.helper.Helper.initNetCipher;
|
||||
|
||||
|
@ -66,6 +66,10 @@ public class MainApplication extends MultiDexApplication {
|
|||
|
||||
private static MainApplication app;
|
||||
|
||||
public static MainApplication getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
@ -75,8 +79,8 @@ public class MainApplication extends MultiDexApplication {
|
|||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
|
||||
ApplicationJob.cancelAllJob(NotificationsSyncJob.NOTIFICATION_REFRESH);
|
||||
if( Helper.liveNotifType(getApplicationContext()) == Helper.NOTIF_NONE) {
|
||||
NotificationsSyncJob.schedule(false);
|
||||
if (Helper.liveNotifType(getApplicationContext()) == Helper.NOTIF_NONE) {
|
||||
NotificationsSyncJob.schedule(false);
|
||||
}
|
||||
|
||||
Cyanea.init(this, super.getResources());
|
||||
|
@ -97,17 +101,17 @@ public class MainApplication extends MultiDexApplication {
|
|||
boolean pref_color_navigation_bar = prefs.getBoolean("pref_color_navigation_bar", true);
|
||||
boolean pref_color_status_bar = prefs.getBoolean("pref_color_status_bar", true);
|
||||
Cyanea.Editor editor = Cyanea.getInstance().edit();
|
||||
if( primary != -1 ) {
|
||||
if (primary != -1) {
|
||||
editor.primary(primary);
|
||||
}
|
||||
if( accent != -1){
|
||||
if (accent != -1) {
|
||||
editor.accent(accent);
|
||||
}
|
||||
if( pref_color_background != -1){
|
||||
if (pref_color_background != -1) {
|
||||
editor
|
||||
.background(pref_color_background)
|
||||
.backgroundLight(pref_color_background)
|
||||
.backgroundDark(pref_color_background).apply();
|
||||
.background(pref_color_background)
|
||||
.backgroundLight(pref_color_background)
|
||||
.backgroundDark(pref_color_background).apply();
|
||||
}
|
||||
editor.shouldTintStatusBar(pref_color_status_bar).apply();
|
||||
editor.shouldTintNavBar(pref_color_navigation_bar).apply();
|
||||
|
@ -166,14 +170,9 @@ public class MainApplication extends MultiDexApplication {
|
|||
Toasty.Config.getInstance().apply();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(MainApplication.this);
|
||||
}
|
||||
|
||||
public static MainApplication getApp() {
|
||||
return app;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,34 +17,31 @@ package app.fedilab.android.activities;
|
|||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.drawers.AccountsInAListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,6 @@ import android.animation.AnimatorListenerAdapter;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
|
@ -44,7 +43,6 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
@ -167,7 +165,7 @@ public class MastodonRegisterActivity extends BaseActivity implements OnRetrieve
|
|||
}
|
||||
});
|
||||
|
||||
new RetrieveInstanceRegAsyncTask(MastodonRegisterActivity.this, RetrieveInstanceRegAsyncTask.instanceType.MASTODON,"general", MastodonRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
new RetrieveInstanceRegAsyncTask(MastodonRegisterActivity.this, RetrieveInstanceRegAsyncTask.instanceType.MASTODON, "general", MastodonRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
|
||||
signup = findViewById(R.id.signup);
|
||||
EditText username = findViewById(R.id.username);
|
||||
|
@ -206,7 +204,7 @@ public class MastodonRegisterActivity extends BaseActivity implements OnRetrieve
|
|||
accountCreation.setPassword(password.getText().toString().trim());
|
||||
accountCreation.setPasswordConfirm(password_confirm.getText().toString().trim());
|
||||
accountCreation.setUsername(username.getText().toString().trim());
|
||||
new CreateMastodonAccountAsyncTask(MastodonRegisterActivity.this,RetrieveInstanceRegAsyncTask.instanceType.MASTODON, accountCreation, instance, MastodonRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
new CreateMastodonAccountAsyncTask(MastodonRegisterActivity.this, RetrieveInstanceRegAsyncTask.instanceType.MASTODON, accountCreation, instance, MastodonRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -39,12 +39,10 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.HttpURLConnection;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -41,7 +40,6 @@ import android.widget.Toast;
|
|||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
|
@ -49,15 +47,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
|
@ -87,6 +79,7 @@ import es.dmoral.toasty.Toasty;
|
|||
|
||||
public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDomainsInterface, OnPostActionInterface {
|
||||
|
||||
private final int PICK_IMPORT_INSTANCE = 5326;
|
||||
private boolean flag_loading;
|
||||
private AsyncTask<Void, Void, Void> asyncTask;
|
||||
private DomainsListAdapter domainsListAdapter;
|
||||
|
@ -97,7 +90,6 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
|
|||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private boolean swiped;
|
||||
private RecyclerView lv_domains;
|
||||
private final int PICK_IMPORT_INSTANCE = 5326;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -392,10 +384,10 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
|
|||
@Override
|
||||
public void onPostAction(int statusCode, API.StatusAction statusAction, String userId, Error error) {
|
||||
if (error != null) {
|
||||
if(error.getError().length() < 100) {
|
||||
if (error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -34,18 +30,21 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveOpenCollectiveAsyncTask;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Results;
|
||||
import app.fedilab.android.drawers.AccountSearchDevAdapter;
|
||||
import app.fedilab.android.helper.ExpandableHeightListView;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveOpenCollectiveAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -35,16 +34,13 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.components.Description;
|
||||
import com.github.mikephil.charting.components.IMarker;
|
||||
import com.github.mikephil.charting.components.Legend;
|
||||
import com.github.mikephil.charting.components.MarkerView;
|
||||
import com.github.mikephil.charting.components.XAxis;
|
||||
|
@ -76,7 +72,6 @@ import app.fedilab.android.interfaces.OnRetrieveChartsInterface;
|
|||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -94,6 +89,31 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
|
|||
private int theme;
|
||||
private RelativeLayout loader;
|
||||
private ImageButton validate;
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -231,59 +251,6 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
|
|||
|
||||
}
|
||||
|
||||
public class CustomMarkerView extends MarkerView {
|
||||
private TextView tvContent;
|
||||
|
||||
public CustomMarkerView(Context context, int layoutResource) {
|
||||
super(context, layoutResource);
|
||||
tvContent = findViewById(R.id.tvContent);
|
||||
tvContent.setTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshContent(Entry e, Highlight highlight) {
|
||||
Date date = new Date(((long) e.getX()));
|
||||
tvContent.setText(String.valueOf(Helper.shortDateToString(date) + " - " + (int) e.getY()));
|
||||
super.refreshContent(e, highlight);
|
||||
}
|
||||
|
||||
private MPPointF mOffset;
|
||||
|
||||
@Override
|
||||
public MPPointF getOffset() {
|
||||
if (mOffset == null) {
|
||||
mOffset = new MPPointF(-(getWidth() / 2), -getHeight());
|
||||
}
|
||||
return mOffset;
|
||||
}
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
|
@ -311,7 +278,6 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCharts(Charts charts) {
|
||||
|
||||
|
@ -442,6 +408,31 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
|
|||
chart.invalidate();
|
||||
}
|
||||
|
||||
public class CustomMarkerView extends MarkerView {
|
||||
private TextView tvContent;
|
||||
private MPPointF mOffset;
|
||||
|
||||
public CustomMarkerView(Context context, int layoutResource) {
|
||||
super(context, layoutResource);
|
||||
tvContent = findViewById(R.id.tvContent);
|
||||
tvContent.setTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshContent(Entry e, Highlight highlight) {
|
||||
Date date = new Date(((long) e.getX()));
|
||||
tvContent.setText(Helper.shortDateToString(date) + " - " + (int) e.getY());
|
||||
super.refreshContent(e, highlight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MPPointF getOffset() {
|
||||
if (mOffset == null) {
|
||||
mOffset = new MPPointF(-(getWidth() / 2), -getHeight());
|
||||
}
|
||||
return mOffset;
|
||||
}
|
||||
}
|
||||
|
||||
public class MyXAxisValueFormatter extends ValueFormatter {
|
||||
private DateFormat mDataFormat;
|
||||
|
|
|
@ -39,7 +39,6 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -58,9 +57,7 @@ import java.text.DecimalFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveNotificationStatsAsyncTask;
|
||||
|
@ -68,14 +65,12 @@ import app.fedilab.android.asynctasks.RetrieveNotificationsCacheAsyncTask;
|
|||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Notification;
|
||||
import app.fedilab.android.client.Entities.Statistics;
|
||||
import app.fedilab.android.client.Entities.StatisticsNotification;
|
||||
import app.fedilab.android.drawers.NotificationsListAdapter;
|
||||
import app.fedilab.android.helper.FilterNotifications;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveCacheNotificationsInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveNotificationStatsInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveStatsInterface;
|
||||
import app.fedilab.android.services.BackupNotificationInDataBaseService;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.NotificationCacheDAO;
|
||||
|
@ -91,6 +86,7 @@ import es.dmoral.toasty.Toasty;
|
|||
public class OwnerNotificationActivity extends BaseActivity implements OnRetrieveCacheNotificationsInterface, OnRetrieveNotificationStatsInterface {
|
||||
|
||||
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private ImageView pp_actionBar;
|
||||
private NotificationsListAdapter notificationsListAdapter;
|
||||
private String max_id;
|
||||
|
@ -100,14 +96,47 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
|
|||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private boolean swiped;
|
||||
private boolean flag_loading;
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private int style;
|
||||
private Button settings_time_from, settings_time_to;
|
||||
private FilterNotifications filterNotifications;
|
||||
private Date dateIni, dateEnd;
|
||||
private View statsDialogView;
|
||||
private StatisticsNotification statistics;
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
max_id = null;
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -238,32 +267,6 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
|
|||
return true;
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
@ -415,18 +418,6 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
max_id = null;
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
|
|
@ -36,7 +36,6 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
|
@ -76,8 +75,6 @@ import app.fedilab.android.sqlite.NotificationCacheDAO;
|
|||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
|
||||
import static app.fedilab.android.sqlite.StatusCacheDAO.NOTIFICATION_CACHE;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas on 26/08/2019.
|
||||
|
@ -95,6 +92,31 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
|
|||
private RelativeLayout loader;
|
||||
private ImageButton validate;
|
||||
private String status_id;
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -451,59 +473,6 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
|
|||
chart.invalidate();
|
||||
}
|
||||
|
||||
public class CustomMarkerView extends MarkerView {
|
||||
private TextView tvContent;
|
||||
|
||||
public CustomMarkerView(Context context, int layoutResource) {
|
||||
super(context, layoutResource);
|
||||
tvContent = findViewById(R.id.tvContent);
|
||||
tvContent.setTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshContent(Entry e, Highlight highlight) {
|
||||
Date date = new Date(((long) e.getX()));
|
||||
tvContent.setText(String.valueOf(Helper.shortDateToString(date) + " - " + (int) e.getY()));
|
||||
super.refreshContent(e, highlight);
|
||||
}
|
||||
|
||||
private MPPointF mOffset;
|
||||
|
||||
@Override
|
||||
public MPPointF getOffset() {
|
||||
if (mOffset == null) {
|
||||
mOffset = new MPPointF(-(getWidth() / 2), -getHeight());
|
||||
}
|
||||
return mOffset;
|
||||
}
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
@ -534,6 +503,31 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
public class CustomMarkerView extends MarkerView {
|
||||
private TextView tvContent;
|
||||
private MPPointF mOffset;
|
||||
|
||||
public CustomMarkerView(Context context, int layoutResource) {
|
||||
super(context, layoutResource);
|
||||
tvContent = findViewById(R.id.tvContent);
|
||||
tvContent.setTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshContent(Entry e, Highlight highlight) {
|
||||
Date date = new Date(((long) e.getX()));
|
||||
tvContent.setText(Helper.shortDateToString(date) + " - " + (int) e.getY());
|
||||
super.refreshContent(e, highlight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MPPointF getOffset() {
|
||||
if (mOffset == null) {
|
||||
mOffset = new MPPointF(-(getWidth() / 2), -getHeight());
|
||||
}
|
||||
return mOffset;
|
||||
}
|
||||
}
|
||||
|
||||
public class MyXAxisValueFormatter extends ValueFormatter {
|
||||
private DateFormat mDataFormat;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
|
@ -27,16 +26,6 @@ import android.database.sqlite.SQLiteDatabase;
|
|||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -55,6 +44,15 @@ import android.widget.Spinner;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
@ -65,6 +63,8 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveStatsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -73,15 +73,13 @@ import app.fedilab.android.client.Entities.Status;
|
|||
import app.fedilab.android.drawers.StatusListAdapter;
|
||||
import app.fedilab.android.helper.FilterToots;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveStatsInterface;
|
||||
import app.fedilab.android.services.BackupStatusInDataBaseService;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -92,6 +90,7 @@ import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
|||
public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeedsInterface, OnRetrieveStatsInterface {
|
||||
|
||||
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private ImageView pp_actionBar;
|
||||
private StatusListAdapter statusListAdapter;
|
||||
private String max_id;
|
||||
|
@ -101,14 +100,47 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
|||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private boolean swiped;
|
||||
private boolean flag_loading;
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private int style;
|
||||
private Button settings_time_from, settings_time_to;
|
||||
private FilterToots filterToots;
|
||||
private Date dateIni, dateEnd;
|
||||
private View statsDialogView;
|
||||
private Statistics statistics;
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
max_id = null;
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -238,32 +270,6 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
|||
return true;
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener iniDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 0, 0);
|
||||
dateIni = new Date(c.getTimeInMillis());
|
||||
settings_time_from.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
private DatePickerDialog.OnDateSetListener endDateSetListener =
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
|
||||
public void onDateSet(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(year, monthOfYear, dayOfMonth, 23, 59);
|
||||
|
||||
dateEnd = new Date(c.getTimeInMillis());
|
||||
settings_time_to.setText(Helper.shortDateToString(new Date(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
@ -483,18 +489,6 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
|
|||
|
||||
}
|
||||
|
||||
|
||||
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
max_id = null;
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
|
|
@ -14,18 +14,12 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -36,9 +30,15 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Relationship;
|
||||
|
@ -46,12 +46,9 @@ import app.fedilab.android.client.Entities.Results;
|
|||
import app.fedilab.android.drawers.AccountSearchDevAdapter;
|
||||
import app.fedilab.android.helper.ExpandableHeightListView;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRemoteDataAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRelationshipInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,15 +32,6 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -60,6 +51,14 @@ import android.widget.ScrollView;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.exoplayer2.ExoPlayerFactory;
|
||||
import com.google.android.exoplayer2.SimpleExoPlayer;
|
||||
import com.google.android.exoplayer2.source.ExtractorMediaSource;
|
||||
|
@ -82,7 +81,13 @@ import java.util.Objects;
|
|||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManagePlaylistsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleCommentsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -96,6 +101,8 @@ import app.fedilab.android.helper.CrossActions;
|
|||
import app.fedilab.android.helper.FullScreenMediaController;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnPlaylistActionInterface;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.PeertubeFavoritesDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
|
@ -103,14 +110,6 @@ import app.fedilab.android.webview.CustomWebview;
|
|||
import app.fedilab.android.webview.MastalabWebChromeClient;
|
||||
import app.fedilab.android.webview.MastalabWebViewClient;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleCommentsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
|
||||
import static app.fedilab.android.asynctasks.ManagePlaylistsAsyncTask.action.GET_PLAYLIST;
|
||||
import static app.fedilab.android.asynctasks.ManagePlaylistsAsyncTask.action.GET_PLAYLIST_FOR_VIDEO;
|
||||
|
@ -124,6 +123,7 @@ import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
|||
|
||||
public class PeertubeActivity extends BaseActivity implements OnRetrievePeertubeInterface, OnPostActionInterface, OnPlaylistActionInterface {
|
||||
|
||||
public static String video_id;
|
||||
private String peertubeInstance, videoId;
|
||||
private FullScreenMediaController.fullscreen fullscreen;
|
||||
private RelativeLayout loader;
|
||||
|
@ -132,7 +132,6 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
private int stopPosition;
|
||||
private Peertube peertube;
|
||||
private TextView toolbar_title;
|
||||
public static String video_id;
|
||||
private SimpleExoPlayerView playerView;
|
||||
private SimpleExoPlayer player;
|
||||
private boolean fullScreenMode;
|
||||
|
@ -149,6 +148,13 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
private List<String> playlistForVideo;
|
||||
private List<Playlist> playlists;
|
||||
|
||||
public static void hideKeyboard(Activity activity) {
|
||||
if (activity != null && activity.getWindow() != null && activity.getWindow().getDecorView() != null) {
|
||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -339,7 +345,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
if ((ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_MOVE) &&
|
||||
v instanceof EditText &&
|
||||
v.getId() == R.id.add_comment_write) {
|
||||
int scrcoords[] = new int[2];
|
||||
int[] scrcoords = new int[2];
|
||||
v.getLocationOnScreen(scrcoords);
|
||||
float x = ev.getRawX() + v.getLeft() - scrcoords[0];
|
||||
float y = ev.getRawY() + v.getTop() - scrcoords[1];
|
||||
|
@ -354,13 +360,6 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
public static void hideKeyboard(Activity activity) {
|
||||
if (activity != null && activity.getWindow() != null && activity.getWindow().getDecorView() != null) {
|
||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.main_webview, menu);
|
||||
|
|
|
@ -15,19 +15,12 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -40,6 +33,10 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -48,20 +45,20 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostPeertubeAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeChannelsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Peertube;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostPeertubeAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeChannelsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeSingleAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import mabbas007.tagsedittext.TagsEditText;
|
||||
|
||||
import static android.os.AsyncTask.THREAD_POOL_EXECUTOR;
|
||||
|
@ -70,6 +67,11 @@ import static app.fedilab.android.asynctasks.RetrievePeertubeInformationAsyncTas
|
|||
public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrievePeertubeInterface, OnPostActionInterface {
|
||||
|
||||
|
||||
HashMap<Integer, String> categoryToSend;
|
||||
HashMap<Integer, String> licenseToSend;
|
||||
HashMap<Integer, String> privacyToSend;
|
||||
HashMap<String, String> languageToSend;
|
||||
HashMap<String, String> channelToSend;
|
||||
private Button set_upload_submit, set_upload_delete;
|
||||
private MaterialSpinner set_upload_privacy, set_upload_categories, set_upload_licenses, set_upload_languages, set_upload_channel;
|
||||
private EditText p_video_title, p_video_description;
|
||||
|
@ -78,11 +80,6 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
private LinkedHashMap<String, String> channels;
|
||||
private String videoId;
|
||||
private Account channel;
|
||||
HashMap<Integer, String> categoryToSend;
|
||||
HashMap<Integer, String> licenseToSend;
|
||||
HashMap<Integer, String> privacyToSend;
|
||||
HashMap<String, String> languageToSend;
|
||||
HashMap<String, String> channelToSend;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -148,8 +145,6 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
set_upload_enable_comments = findViewById(R.id.set_upload_enable_comments);
|
||||
|
||||
|
||||
|
||||
|
||||
set_upload_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -196,10 +191,10 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pair = (Map.Entry) it.next();
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey((String) pair.getValue()))
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey(pair.getValue()))
|
||||
categoriesA[i] = (String) pair.getValue();
|
||||
else
|
||||
categoriesA[i] = translations.get((String) pair.getValue());
|
||||
categoriesA[i] = translations.get(pair.getValue());
|
||||
it.remove();
|
||||
i++;
|
||||
}
|
||||
|
@ -214,10 +209,10 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pair = (Map.Entry) it.next();
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey((String) pair.getValue()))
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey(pair.getValue()))
|
||||
licensesA[i] = (String) pair.getValue();
|
||||
else
|
||||
licensesA[i] = translations.get((String) pair.getValue());
|
||||
licensesA[i] = translations.get(pair.getValue());
|
||||
it.remove();
|
||||
i++;
|
||||
}
|
||||
|
@ -232,10 +227,10 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pair = (Map.Entry) it.next();
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey((String) pair.getValue()))
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey(pair.getValue()))
|
||||
languagesA[i] = (String) pair.getValue();
|
||||
else
|
||||
languagesA[i] = translations.get((String) pair.getValue());
|
||||
languagesA[i] = translations.get(pair.getValue());
|
||||
it.remove();
|
||||
i++;
|
||||
}
|
||||
|
@ -250,10 +245,10 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pair = (Map.Entry) it.next();
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey((String) pair.getValue()))
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey(pair.getValue()))
|
||||
privaciesA[i] = (String) pair.getValue();
|
||||
else
|
||||
privaciesA[i] = translations.get((String) pair.getValue());
|
||||
privaciesA[i] = translations.get(pair.getValue());
|
||||
it.remove();
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -16,12 +16,10 @@ package app.fedilab.android.activities;
|
|||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
|
@ -42,16 +40,10 @@ import android.widget.Toast;
|
|||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
|
@ -121,7 +113,7 @@ public class PeertubeRegisterActivity extends BaseActivity implements OnRetrieve
|
|||
}
|
||||
|
||||
|
||||
new RetrieveInstanceRegAsyncTask(PeertubeRegisterActivity.this,RetrieveInstanceRegAsyncTask.instanceType.PEERTUBE, null, PeertubeRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
new RetrieveInstanceRegAsyncTask(PeertubeRegisterActivity.this, RetrieveInstanceRegAsyncTask.instanceType.PEERTUBE, null, PeertubeRegisterActivity.this).executeOnExecutor(THREAD_POOL_EXECUTOR);
|
||||
|
||||
signup = findViewById(R.id.signup);
|
||||
EditText username = findViewById(R.id.username);
|
||||
|
|
|
@ -16,7 +16,6 @@ package app.fedilab.android.activities;
|
|||
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
|
@ -27,15 +26,8 @@ import android.database.Cursor;
|
|||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.OpenableColumns;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -47,6 +39,10 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.jaredrummler.materialspinner.MaterialSpinner;
|
||||
|
||||
import net.gotev.uploadservice.MultipartUploadRequest;
|
||||
|
@ -68,13 +64,13 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeChannelsAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrievePeertubeChannelsAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.android.asynctasks.RetrievePeertubeInformationAsyncTask.peertubeInformation;
|
||||
|
||||
|
@ -82,12 +78,12 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
|
||||
|
||||
private final int PICK_IVDEO = 52378;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 724;
|
||||
private Button set_upload_file, set_upload_submit;
|
||||
private MaterialSpinner set_upload_privacy, set_upload_channel;
|
||||
private TextView set_upload_file_name;
|
||||
private EditText video_title;
|
||||
private HashMap<String, String> channels;
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 724;
|
||||
private Uri uri;
|
||||
private String filename;
|
||||
private HashMap<Integer, String> privacyToSend;
|
||||
|
@ -231,11 +227,11 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
android.R.layout.simple_spinner_dropdown_item, channelName);
|
||||
set_upload_channel.setAdapter(adapterChannel);
|
||||
|
||||
if( peertubeInformation == null){
|
||||
if (peertubeInformation == null) {
|
||||
return;
|
||||
}
|
||||
LinkedHashMap<String, String> translations = null;
|
||||
if ( peertubeInformation.getTranslations() != null)
|
||||
if (peertubeInformation.getTranslations() != null)
|
||||
translations = new LinkedHashMap<>(peertubeInformation.getTranslations());
|
||||
|
||||
LinkedHashMap<Integer, String> privaciesInit = new LinkedHashMap<>(peertubeInformation.getPrivacies());
|
||||
|
@ -249,7 +245,7 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
i = 0;
|
||||
while (it.hasNext()) {
|
||||
Map.Entry pair = (Map.Entry) it.next();
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey((String) pair.getValue()))
|
||||
if (translations == null || translations.size() == 0 || !translations.containsKey(pair.getValue()))
|
||||
privaciesA[i] = (String) pair.getValue();
|
||||
else
|
||||
privaciesA[i] = translations.get(pair.getValue());
|
||||
|
@ -356,7 +352,7 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
uploadConfig.getCancelled().message = getString(R.string.toast_cancelled);
|
||||
uploadConfig.getCompleted().actions.add(new UploadNotificationAction(R.drawable.ic_check, getString(R.string.video_uploaded_action), clickIntent));
|
||||
|
||||
if( video_title != null && video_title.getText() != null && video_title.getText().toString().trim().length() > 0 ){
|
||||
if (video_title != null && video_title.getText() != null && video_title.getText().toString().trim().length() > 0) {
|
||||
filename = video_title.getText().toString().trim();
|
||||
}
|
||||
String uploadId = UUID.randomUUID().toString();
|
||||
|
|
|
@ -14,17 +14,41 @@ package app.fedilab.android.activities;
|
|||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.view.animation.AnticipateOvershootInterpolator;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.transition.ChangeBounds;
|
||||
import androidx.transition.TransitionManager;
|
||||
|
||||
import android.view.Window;
|
||||
import com.theartofdev.edmodo.cropper.CropImage;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
@ -36,43 +60,10 @@ import app.fedilab.android.imageeditor.filters.FilterListener;
|
|||
import app.fedilab.android.imageeditor.filters.FilterViewAdapter;
|
||||
import app.fedilab.android.imageeditor.tools.EditingToolsAdapter;
|
||||
import app.fedilab.android.imageeditor.tools.ToolType;
|
||||
import ja.burhanrashid52.photoeditor.OnPhotoEditorListener;
|
||||
import ja.burhanrashid52.photoeditor.PhotoEditor;
|
||||
import ja.burhanrashid52.photoeditor.PhotoEditorView;
|
||||
import ja.burhanrashid52.photoeditor.PhotoFilter;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Typeface;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.transition.ChangeBounds;
|
||||
import androidx.transition.TransitionManager;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.animation.AnticipateOvershootInterpolator;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.theartofdev.edmodo.cropper.CropImage;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import ja.burhanrashid52.photoeditor.OnPhotoEditorListener;
|
||||
import ja.burhanrashid52.photoeditor.SaveSettings;
|
||||
import ja.burhanrashid52.photoeditor.ViewType;
|
||||
|
||||
|
@ -102,6 +93,17 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorLi
|
|||
private String tempname;
|
||||
private boolean exit;
|
||||
|
||||
private static int exifToDegrees(int exifOrientation) {
|
||||
if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
|
||||
return 90;
|
||||
} else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
|
||||
return 180;
|
||||
} else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
|
||||
return 270;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -195,17 +197,6 @@ public class PhotoEditorActivity extends BaseActivity implements OnPhotoEditorLi
|
|||
});
|
||||
}
|
||||
|
||||
private static int exifToDegrees(int exifOrientation) {
|
||||
if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
|
||||
return 90;
|
||||
} else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
|
||||
return 180;
|
||||
} else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
|
||||
return 270;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
ImageView imgUndo;
|
||||
ImageView imgRedo;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,21 +14,11 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -39,6 +29,14 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -63,6 +61,7 @@ import static app.fedilab.android.asynctasks.ManagePlaylistsAsyncTask.action.GET
|
|||
public class PlaylistsActivity extends BaseActivity implements OnPlaylistActionInterface {
|
||||
|
||||
|
||||
LinearLayoutManager mLayoutManager;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private boolean swiped;
|
||||
|
@ -72,8 +71,6 @@ public class PlaylistsActivity extends BaseActivity implements OnPlaylistActionI
|
|||
private boolean firstLoad;
|
||||
private boolean flag_loading;
|
||||
private PeertubeAdapter peertubeAdapter;
|
||||
LinearLayoutManager mLayoutManager;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -15,15 +15,9 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -32,8 +26,11 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,13 +18,9 @@ package app.fedilab.android.activities;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
|
@ -32,8 +28,8 @@ import android.widget.CheckBox;
|
|||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,15 +24,6 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -52,6 +43,13 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -61,6 +59,9 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.ManageTimelines;
|
||||
import app.fedilab.android.client.Entities.RemoteInstance;
|
||||
|
@ -70,15 +71,12 @@ import app.fedilab.android.helper.Helper;
|
|||
import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener;
|
||||
import app.fedilab.android.helper.itemtouchhelper.OnUndoListener;
|
||||
import app.fedilab.android.helper.itemtouchhelper.SimpleItemTouchHelperCallback;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.SearchDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,16 +14,10 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package app.fedilab.android.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -35,20 +29,23 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveSearchAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.drawers.SearchListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveSearchAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveSearchInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveSearchStatusInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -141,12 +138,12 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
|
|||
loader.setVisibility(View.GONE);
|
||||
if (apiResponse.getError() != null) {
|
||||
if (apiResponse.getError().getError() != null) {
|
||||
if(apiResponse.getError().getError().length() < 100) {
|
||||
if (apiResponse.getError().getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}else
|
||||
} else
|
||||
Toasty.error(getApplicationContext(), getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
@ -171,10 +168,10 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
|
|||
public void onRetrieveSearchStatus(APIResponse apiResponse, Error error) {
|
||||
loader.setVisibility(View.GONE);
|
||||
if (apiResponse.getError() != null) {
|
||||
if(error.getError().length() < 100) {
|
||||
if (error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -18,18 +18,6 @@ package app.fedilab.android.activities;
|
|||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -39,18 +27,26 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.fragments.DisplayAccountsFragment;
|
||||
import app.fedilab.android.fragments.DisplaySearchTagsFragment;
|
||||
import app.fedilab.android.fragments.DisplayStatusFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,13 +23,13 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
@ -43,8 +43,6 @@ import com.google.android.material.tabs.TabLayout;
|
|||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.fragments.ColorSettingsFragment;
|
||||
import app.fedilab.android.fragments.ContentSettingsFragment;
|
||||
|
@ -55,7 +53,7 @@ import app.fedilab.android.helper.Helper;
|
|||
* Settings activity
|
||||
*/
|
||||
|
||||
public class SettingsActivity extends BaseActivity {
|
||||
public class SettingsActivity extends BaseActivity {
|
||||
|
||||
public static boolean needRestart;
|
||||
|
||||
|
@ -91,9 +89,9 @@ public class SettingsActivity extends BaseActivity {
|
|||
toolbar_close.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if( needRestart){
|
||||
if (needRestart) {
|
||||
showDialog();
|
||||
}else{
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -147,6 +145,7 @@ public class SettingsActivity extends BaseActivity {
|
|||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
|
@ -156,6 +155,43 @@ public class SettingsActivity extends BaseActivity {
|
|||
|
||||
}
|
||||
|
||||
private void showDialog() {
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this);
|
||||
dialogBuilder.setMessage(R.string.restart_message);
|
||||
dialogBuilder.setTitle(R.string.apply_changes);
|
||||
dialogBuilder.setPositiveButton(R.string.restart, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Intent mStartActivity = new Intent(getApplicationContext(), MainActivity.class);
|
||||
int mPendingIntentId = 123456;
|
||||
PendingIntent mPendingIntent = PendingIntent.getActivity(getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||
assert mgr != null;
|
||||
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
dialogBuilder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.show();
|
||||
|
||||
needRestart = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (needRestart) {
|
||||
showDialog();
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
private class SettingsPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
|
@ -205,44 +241,4 @@ public class SettingsActivity extends BaseActivity {
|
|||
return 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void showDialog(){
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this);
|
||||
dialogBuilder.setMessage(R.string.restart_message);
|
||||
dialogBuilder.setTitle(R.string.apply_changes);
|
||||
dialogBuilder.setPositiveButton(R.string.restart, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Intent mStartActivity = new Intent(getApplicationContext(), MainActivity.class);
|
||||
int mPendingIntentId = 123456;
|
||||
PendingIntent mPendingIntent = PendingIntent.getActivity(getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager mgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
|
||||
assert mgr != null;
|
||||
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
dialogBuilder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.show();
|
||||
|
||||
needRestart = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if( needRestart){
|
||||
showDialog();
|
||||
}else{
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,22 +26,6 @@ import android.graphics.drawable.Drawable;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.exoplayer2.Timeline;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
|
@ -60,9 +44,21 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -70,13 +66,19 @@ import java.util.Iterator;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -96,25 +98,18 @@ import app.fedilab.android.fragments.TabLayoutTootsFragment;
|
|||
import app.fedilab.android.helper.CrossActions;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.NotesDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TempMuteDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveRelationshipAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRelationshipInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.NotesDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TempMuteDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.android.activities.BaseMainActivity.mutedAccount;
|
||||
import static app.fedilab.android.activities.BaseMainActivity.timelines;
|
||||
|
@ -157,15 +152,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
private ScheduledExecutorService scheduledExecutorService;
|
||||
private AsyncTask<Void, Void, Void> accountAsync;
|
||||
private AsyncTask<Void, Void, Void> retrieveRelationship;
|
||||
|
||||
|
||||
public enum action {
|
||||
FOLLOW,
|
||||
UNFOLLOW,
|
||||
UNBLOCK,
|
||||
NOTHING
|
||||
}
|
||||
|
||||
private action doAction;
|
||||
private API.StatusAction doActionAccount;
|
||||
|
||||
|
@ -297,7 +283,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void ManageAccount() {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
|
@ -831,10 +816,10 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
});
|
||||
|
||||
UserNote userNote = new NotesDAO(getApplicationContext(), db).getUserNote(account.getAcct());
|
||||
if( userNote != null ){
|
||||
if (userNote != null) {
|
||||
|
||||
account_personal_note.setVisibility(View.VISIBLE);
|
||||
account_personal_note.setOnClickListener(view->{
|
||||
account_personal_note.setOnClickListener(view -> {
|
||||
AlertDialog.Builder builderInner = new AlertDialog.Builder(ShowAccountActivity.this, style);
|
||||
builderInner.setTitle(R.string.note_for_account);
|
||||
EditText input = new EditText(ShowAccountActivity.this);
|
||||
|
@ -856,15 +841,15 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
UserNote userNote = new NotesDAO(getApplicationContext(), db).getUserNote(account.getAcct());
|
||||
if( userNote == null) {
|
||||
if (userNote == null) {
|
||||
userNote = new UserNote();
|
||||
userNote.setAcct(account.getAcct());
|
||||
}
|
||||
userNote.setNote(input.getText().toString());
|
||||
new NotesDAO(getApplicationContext(), db).insertInstance(userNote);
|
||||
if( input.getText().toString().trim().length() > 0 ){
|
||||
if (input.getText().toString().trim().length() > 0) {
|
||||
account_personal_note.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
} else {
|
||||
account_personal_note.setVisibility(View.GONE);
|
||||
}
|
||||
dialog.dismiss();
|
||||
|
@ -903,7 +888,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
}).start();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRetrieveFeedsAccount(List<Status> statuses) {
|
||||
if (statuses != null) {
|
||||
|
@ -929,15 +913,14 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRetrieveRelationship(Relationship relationship, Error error) {
|
||||
|
||||
if (error != null) {
|
||||
if(error.getError().length() < 100) {
|
||||
if (error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -982,93 +965,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
account_follow.setImageResource(R.drawable.ic_user_plus);
|
||||
doAction = action.FOLLOW;
|
||||
account_follow.setVisibility(View.VISIBLE);
|
||||
;
|
||||
} else {
|
||||
account_follow.setVisibility(View.GONE);
|
||||
doAction = action.NOTHING;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pager adapter for the 4 fragments
|
||||
*/
|
||||
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
ScreenSlidePagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Bundle bundle = new Bundle();
|
||||
switch (position) {
|
||||
case 0:
|
||||
if (!peertubeAccount) {
|
||||
if( MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
|
||||
TabLayoutTootsFragment tabLayoutTootsFragment = new TabLayoutTootsFragment();
|
||||
bundle.putString("targetedid", account.getId());
|
||||
tabLayoutTootsFragment.setArguments(bundle);
|
||||
return tabLayoutTootsFragment;
|
||||
}else{
|
||||
DisplayStatusFragment displayStatusFragment = new DisplayStatusFragment();
|
||||
bundle = new Bundle();
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
|
||||
bundle.putString("instanceType", "PIXELFED");
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayStatusFragment.setArguments(bundle);
|
||||
return displayStatusFragment;
|
||||
}
|
||||
} else {
|
||||
DisplayStatusFragment displayStatusFragment = new DisplayStatusFragment();
|
||||
bundle = new Bundle();
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
|
||||
bundle.putString("targetedid", account.getAcct());
|
||||
bundle.putString("instanceType", "PEERTUBE");
|
||||
bundle.putBoolean("showReply", false);
|
||||
bundle.putBoolean("ischannel", ischannel);
|
||||
displayStatusFragment.setArguments(bundle);
|
||||
return displayStatusFragment;
|
||||
}
|
||||
case 1:
|
||||
if (peertubeAccount) {
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.CHANNELS);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
bundle.putString("instance", Helper.getLiveInstance(ShowAccountActivity.this));
|
||||
bundle.putString("name", account.getAcct());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
} else {
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWING);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
}
|
||||
|
||||
case 2:
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWERS);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (ischannel)
|
||||
return 1;
|
||||
else if (peertubeAccount)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRetrieveEmojiAccount(Account account) {
|
||||
account_note.setText(account.getNoteSpan(), TextView.BufferType.SPANNABLE);
|
||||
|
@ -1122,7 +1024,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
labelView.setText(label);
|
||||
}
|
||||
if (field != null && labelView != null && valueView != null) {
|
||||
boolean verified = fieldsVerified.get((String) pair.getKey().toString());
|
||||
boolean verified = fieldsVerified.get(pair.getKey().toString());
|
||||
if (verified) {
|
||||
valueView.setBackgroundResource(R.drawable.verified);
|
||||
value.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ShowAccountActivity.this, R.color.verified_text)), 0, value.toString().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
@ -1455,7 +1357,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
input.setLayoutParams(lp);
|
||||
input.setSingleLine(false);
|
||||
if( userNote != null) {
|
||||
if (userNote != null) {
|
||||
input.setText(userNote.getNote());
|
||||
}
|
||||
input.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
||||
|
@ -1470,15 +1372,15 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
UserNote userNote = new NotesDAO(getApplicationContext(), db).getUserNote(account.getAcct());
|
||||
if( userNote == null) {
|
||||
if (userNote == null) {
|
||||
userNote = new UserNote();
|
||||
userNote.setAcct(account.getAcct());
|
||||
}
|
||||
userNote.setNote(input.getText().toString());
|
||||
new NotesDAO(getApplicationContext(), db).insertInstance(userNote);
|
||||
if( input.getText().toString().trim().length() > 0 ){
|
||||
if (input.getText().toString().trim().length() > 0) {
|
||||
account_personal_note.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
} else {
|
||||
account_personal_note.setVisibility(View.GONE);
|
||||
}
|
||||
dialog.dismiss();
|
||||
|
@ -1526,13 +1428,11 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
popup.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
@ -1551,10 +1451,10 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
public void onPostAction(int statusCode, API.StatusAction statusAction, String targetedId, Error error) {
|
||||
|
||||
if (error != null) {
|
||||
if(error.getError().length() < 100) {
|
||||
if (error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1576,19 +1476,17 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
retrieveRelationship = new RetrieveRelationshipAsyncTask(getApplicationContext(), target, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRetrieveAccount(final Account account, Error error) {
|
||||
|
||||
if (error != null || account == null || account.getAcct() == null) {
|
||||
if (error == null)
|
||||
Toasty.error(getApplicationContext(), getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
else
|
||||
if(error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error,"\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
else if (error.getError().length() < 100) {
|
||||
Toasty.error(getApplicationContext(), error.getError(), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.long_api_error, "\ud83d\ude05"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.account = account;
|
||||
|
@ -1607,7 +1505,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean showReplies() {
|
||||
return show_replies;
|
||||
}
|
||||
|
@ -1616,4 +1513,92 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
return show_boosts;
|
||||
}
|
||||
|
||||
|
||||
public enum action {
|
||||
FOLLOW,
|
||||
UNFOLLOW,
|
||||
UNBLOCK,
|
||||
NOTHING
|
||||
}
|
||||
|
||||
/**
|
||||
* Pager adapter for the 4 fragments
|
||||
*/
|
||||
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
ScreenSlidePagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Bundle bundle = new Bundle();
|
||||
switch (position) {
|
||||
case 0:
|
||||
if (!peertubeAccount) {
|
||||
if (MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
|
||||
TabLayoutTootsFragment tabLayoutTootsFragment = new TabLayoutTootsFragment();
|
||||
bundle.putString("targetedid", account.getId());
|
||||
tabLayoutTootsFragment.setArguments(bundle);
|
||||
return tabLayoutTootsFragment;
|
||||
} else {
|
||||
DisplayStatusFragment displayStatusFragment = new DisplayStatusFragment();
|
||||
bundle = new Bundle();
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
|
||||
bundle.putString("instanceType", "PIXELFED");
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayStatusFragment.setArguments(bundle);
|
||||
return displayStatusFragment;
|
||||
}
|
||||
} else {
|
||||
DisplayStatusFragment displayStatusFragment = new DisplayStatusFragment();
|
||||
bundle = new Bundle();
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
|
||||
bundle.putString("targetedid", account.getAcct());
|
||||
bundle.putString("instanceType", "PEERTUBE");
|
||||
bundle.putBoolean("showReply", false);
|
||||
bundle.putBoolean("ischannel", ischannel);
|
||||
displayStatusFragment.setArguments(bundle);
|
||||
return displayStatusFragment;
|
||||
}
|
||||
case 1:
|
||||
if (peertubeAccount) {
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.CHANNELS);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
bundle.putString("instance", Helper.getLiveInstance(ShowAccountActivity.this));
|
||||
bundle.putString("name", account.getAcct());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
} else {
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWING);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
}
|
||||
|
||||
case 2:
|
||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
||||
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWERS);
|
||||
bundle.putString("targetedid", account.getId());
|
||||
displayAccountsFragment.setArguments(bundle);
|
||||
return displayAccountsFragment;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (ischannel)
|
||||
return 1;
|
||||
else if (peertubeAccount)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,33 +22,32 @@ import android.content.SharedPreferences;
|
|||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveContextAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.drawers.StatusListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveContextInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveContextAsyncTask;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnRetrieveContextInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -300,9 +299,9 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
|
|||
swipeRefreshLayout.setRefreshing(false);
|
||||
loader.setVisibility(View.GONE);
|
||||
if (apiResponse.getError() != null) {
|
||||
if( apiResponse.getError().getError() != null) {
|
||||
if (apiResponse.getError().getError() != null) {
|
||||
Toasty.error(getApplicationContext(), apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
}else{
|
||||
} else {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return;
|
||||
|
@ -317,7 +316,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
|
|||
statuses.addAll(0, apiResponse.getContext().getAncestors());
|
||||
statusListAdapter.notifyItemRangeInserted(0, apiResponse.getContext().getAncestors().size());
|
||||
}
|
||||
int targetedPosition = statuses.size()-1;
|
||||
int targetedPosition = statuses.size() - 1;
|
||||
if (apiResponse.getContext().getDescendants() != null && apiResponse.getContext().getDescendants().size() > 0) {
|
||||
statuses.addAll(apiResponse.getContext().getAncestors().size() + 1, apiResponse.getContext().getDescendants());
|
||||
statusListAdapter.notifyItemRangeChanged(apiResponse.getContext().getAncestors().size() + 1, apiResponse.getContext().getDescendants().size());
|
||||
|
@ -369,23 +368,23 @@ public class ShowConversationActivity extends BaseActivity implements OnRetrieve
|
|||
}
|
||||
|
||||
|
||||
private void decorate(int targetedPosition){
|
||||
for(int i =0 ; i < statuses.size() ; i++){
|
||||
private void decorate(int targetedPosition) {
|
||||
for (int i = 0; i < statuses.size(); i++) {
|
||||
if (i == targetedPosition) {
|
||||
if( targetedPosition < statuses.size()-1 )
|
||||
if (targetedPosition < statuses.size() - 1)
|
||||
statuses.get(targetedPosition).setShowBottomLine(true);
|
||||
if( targetedPosition > 0 && statuses.get(targetedPosition).getIn_reply_to_id().compareTo(statuses.get(targetedPosition-1).getId()) == 0){
|
||||
statuses.get(targetedPosition-1).setShowBottomLine(true);
|
||||
if (targetedPosition > 0 && statuses.get(targetedPosition).getIn_reply_to_id().compareTo(statuses.get(targetedPosition - 1).getId()) == 0) {
|
||||
statuses.get(targetedPosition - 1).setShowBottomLine(true);
|
||||
statuses.get(targetedPosition).setShowTopLine(true);
|
||||
}
|
||||
} else if (0 < i && i <= statuses.size() - 1) {
|
||||
if( statuses.get(i-1).getId().compareTo(statuses.get(i).getIn_reply_to_id()) == 0){
|
||||
statuses.get(i-1).setShowBottomLine(true);
|
||||
if (statuses.get(i - 1).getId().compareTo(statuses.get(i).getIn_reply_to_id()) == 0) {
|
||||
statuses.get(i - 1).setShowBottomLine(true);
|
||||
statuses.get(i).setShowTopLine(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
statusListAdapter.notifyItemRangeChanged(0,statuses.size());
|
||||
statusListAdapter.notifyItemRangeChanged(0, statuses.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package app.fedilab.android.activities;
|
||||
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.DownloadManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
|
@ -27,7 +26,6 @@ import android.content.SharedPreferences;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -39,12 +37,9 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
@ -53,7 +48,6 @@ import androidx.fragment.app.FragmentStatePagerAdapter;
|
|||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
|
||||
import com.r0adkll.slidr.Slidr;
|
||||
import com.r0adkll.slidr.model.SlidrConfig;
|
||||
import com.r0adkll.slidr.model.SlidrInterface;
|
||||
|
@ -66,7 +60,6 @@ import java.util.ArrayList;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.client.Entities.Attachment;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.HttpsConnection;
|
||||
import app.fedilab.android.fragments.MediaSliderFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnDownloadInterface;
|
||||
|
@ -79,17 +72,40 @@ import app.fedilab.android.interfaces.OnDownloadInterface;
|
|||
|
||||
public class SlideMediaActivity extends BaseActivity implements OnDownloadInterface {
|
||||
|
||||
int flags;
|
||||
private ArrayList<Attachment> attachments;
|
||||
private int mediaPosition;
|
||||
private ViewPager mPager;
|
||||
private long downloadID;
|
||||
private boolean fullscreen;
|
||||
private SlidrInterface slidrInterface;
|
||||
int flags;
|
||||
private TextView media_description;
|
||||
private Handler handler;
|
||||
private boolean swipeEnabled;
|
||||
private int minTouch, maxTouch;
|
||||
private float startX;
|
||||
private float startY;
|
||||
private BroadcastReceiver onDownloadComplete = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
|
||||
if (downloadID == id) {
|
||||
DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
assert manager != null;
|
||||
Uri uri = manager.getUriForDownloadedFile(downloadID);
|
||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_with));
|
||||
ContentResolver cR = context.getContentResolver();
|
||||
shareIntent.setType(cR.getType(uri));
|
||||
try {
|
||||
startActivity(shareIntent);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
private MediaSliderFragment mCurrentFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -182,12 +198,12 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
mPager.setAdapter(mPagerAdapter);
|
||||
|
||||
mPager.setCurrentItem(mediaPosition-1);
|
||||
mPager.setCurrentItem(mediaPosition - 1);
|
||||
|
||||
registerReceiver(onDownloadComplete,new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||
String description = attachments.get(mediaPosition-1).getDescription();
|
||||
registerReceiver(onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||
String description = attachments.get(mediaPosition - 1).getDescription();
|
||||
handler = new Handler();
|
||||
if( description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0 ){
|
||||
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
|
||||
media_description.setText(description);
|
||||
media_description.setVisibility(View.VISIBLE);
|
||||
|
||||
|
@ -198,46 +214,49 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
}
|
||||
}, 3000);
|
||||
|
||||
}else{
|
||||
} else {
|
||||
media_description.setVisibility(View.GONE);
|
||||
}
|
||||
mPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
public void onPageScrollStateChanged(int state) {}
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {}
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
}
|
||||
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
}
|
||||
|
||||
public void onPageSelected(int position) {
|
||||
String description = attachments.get(position).getDescription();
|
||||
if( handler != null) {
|
||||
if (handler != null) {
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
handler = new Handler();
|
||||
if( description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0){
|
||||
media_description.setText(description);
|
||||
media_description.setVisibility(View.VISIBLE);
|
||||
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
|
||||
media_description.setText(description);
|
||||
media_description.setVisibility(View.VISIBLE);
|
||||
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
media_description.setVisibility(View.GONE);
|
||||
}
|
||||
}, 3000);
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
media_description.setVisibility(View.GONE);
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
}else{
|
||||
media_description.setVisibility(View.GONE);
|
||||
} else {
|
||||
media_description.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
SlidrConfig config = new SlidrConfig.Builder()
|
||||
.sensitivity(1f)
|
||||
.scrimColor(Color.BLACK)
|
||||
.scrimStartAlpha(0.8f)
|
||||
.scrimEndAlpha(0f)
|
||||
.position(SlidrPosition.VERTICAL)
|
||||
.velocityThreshold(2400)
|
||||
.distanceThreshold(0.25f)
|
||||
.edgeSize(0.18f)
|
||||
.build();
|
||||
.sensitivity(1f)
|
||||
.scrimColor(Color.BLACK)
|
||||
.scrimStartAlpha(0.8f)
|
||||
.scrimEndAlpha(0f)
|
||||
.position(SlidrPosition.VERTICAL)
|
||||
.velocityThreshold(2400)
|
||||
.distanceThreshold(0.25f)
|
||||
.edgeSize(0.18f)
|
||||
.build();
|
||||
|
||||
|
||||
slidrInterface = Slidr.attach(SlideMediaActivity.this, config);
|
||||
|
@ -246,13 +265,11 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
int screenHeight = size.y;
|
||||
minTouch = (int)(screenHeight * 0.1);
|
||||
maxTouch = (int)(screenHeight * 0.9);
|
||||
minTouch = (int) (screenHeight * 0.1);
|
||||
maxTouch = (int) (screenHeight * 0.9);
|
||||
|
||||
}
|
||||
|
||||
private float startX;
|
||||
private float startY;
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
|
||||
|
@ -266,13 +283,13 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
float endY = event.getY();
|
||||
if (endY > minTouch && endY < maxTouch && isAClick(startX, endX, startY, endY)) {
|
||||
setFullscreen(!fullscreen);
|
||||
if( !fullscreen){
|
||||
if (!fullscreen) {
|
||||
String description = attachments.get(mPager.getCurrentItem()).getDescription();
|
||||
if( handler != null) {
|
||||
if (handler != null) {
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
handler = new Handler();
|
||||
if( description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0){
|
||||
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
|
||||
media_description.setText(description);
|
||||
media_description.setVisibility(View.VISIBLE);
|
||||
|
||||
|
@ -283,7 +300,7 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
}
|
||||
}, 3000);
|
||||
|
||||
}else{
|
||||
} else {
|
||||
media_description.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
@ -301,40 +318,17 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
|
||||
public void togglePlaying(View v) {
|
||||
|
||||
if( mCurrentFragment != null){
|
||||
if (mCurrentFragment != null) {
|
||||
mCurrentFragment.togglePlaying(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean isAClick(float startX, float endX, float startY, float endY) {
|
||||
float differenceX = Math.abs(startX - endX);
|
||||
float differenceY = Math.abs(startY - endY);
|
||||
int CLICK_ACTION_THRESHOLD = 200;
|
||||
return !(differenceX > CLICK_ACTION_THRESHOLD/* =5 */ || differenceY > CLICK_ACTION_THRESHOLD);
|
||||
}
|
||||
private BroadcastReceiver onDownloadComplete = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
|
||||
if (downloadID == id) {
|
||||
DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
assert manager != null;
|
||||
Uri uri = manager.getUriForDownloadedFile(downloadID);
|
||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_with));
|
||||
ContentResolver cR = context.getContentResolver();
|
||||
shareIntent.setType(cR.getType(uri));
|
||||
try {
|
||||
startActivity(shareIntent);
|
||||
}catch (Exception ignored){}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
@ -342,9 +336,6 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
unregisterReceiver(onDownloadComplete);
|
||||
}
|
||||
|
||||
private MediaSliderFragment mCurrentFragment;
|
||||
|
||||
|
||||
public MediaSliderFragment getCurrentFragment() {
|
||||
return mCurrentFragment;
|
||||
}
|
||||
|
@ -359,6 +350,62 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
}
|
||||
|
||||
public void enableSliding(boolean enable) {
|
||||
if (enable && !swipeEnabled) {
|
||||
slidrInterface.unlock();
|
||||
swipeEnabled = true;
|
||||
} else if (!enable && swipeEnabled) {
|
||||
slidrInterface.lock();
|
||||
swipeEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getFullScreen() {
|
||||
return this.fullscreen;
|
||||
}
|
||||
|
||||
public void setFullscreen(boolean fullscreen) {
|
||||
this.fullscreen = fullscreen;
|
||||
if (!fullscreen) {
|
||||
showSystemUI();
|
||||
|
||||
} else {
|
||||
hideSystemUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void hideSystemUI() {
|
||||
// Enables regular immersive mode.
|
||||
// For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
|
||||
// Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE
|
||||
// Set the content to appear under the system bars so that the
|
||||
// content doesn't resize when the system bars hide and show.
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
// Hide the nav bar and status bar
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
// Shows the system bars by removing all the flags
|
||||
// except for the ones that make the content appear under the system bars.
|
||||
private void showSystemUI() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Media Pager
|
||||
*/
|
||||
|
@ -392,63 +439,4 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
|
|||
return attachments.size();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
}
|
||||
|
||||
|
||||
public void enableSliding(boolean enable){
|
||||
if (enable && !swipeEnabled) {
|
||||
slidrInterface.unlock();
|
||||
swipeEnabled = true;
|
||||
}else if( !enable && swipeEnabled) {
|
||||
slidrInterface.lock();
|
||||
swipeEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getFullScreen(){
|
||||
return this.fullscreen;
|
||||
}
|
||||
|
||||
public void setFullscreen(boolean fullscreen)
|
||||
{
|
||||
this.fullscreen = fullscreen;
|
||||
if (!fullscreen) {
|
||||
showSystemUI();
|
||||
|
||||
} else {
|
||||
hideSystemUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void hideSystemUI() {
|
||||
// Enables regular immersive mode.
|
||||
// For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
|
||||
// Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE
|
||||
// Set the content to appear under the system bars so that the
|
||||
// content doesn't resize when the system bars hide and show.
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
// Hide the nav bar and status bar
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
// Shows the system bars by removing all the flags
|
||||
// except for the ones that make the content appear under the system bars.
|
||||
private void showSystemUI() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,27 +19,24 @@ import android.content.SharedPreferences;
|
|||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.drawers.TagsEditAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TagsCacheDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,8 +17,8 @@ package app.fedilab.android.activities;
|
|||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
@ -27,17 +27,15 @@ import androidx.fragment.app.FragmentStatePagerAdapter;
|
|||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.fragments.DisplayAccountsFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,26 +29,25 @@ import android.os.AsyncTask;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.DownloadListener;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.helper.CountDrawable;
|
||||
|
@ -60,7 +59,6 @@ import app.fedilab.android.webview.MastalabWebChromeClient;
|
|||
import app.fedilab.android.webview.MastalabWebViewClient;
|
||||
import app.fedilab.android.webview.ProxyHelper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -70,11 +68,11 @@ import app.fedilab.android.R;
|
|||
|
||||
public class WebviewActivity extends BaseActivity {
|
||||
|
||||
public static List<String> trackingDomains;
|
||||
private String url;
|
||||
private String peertubeLinkToFetch;
|
||||
private boolean peertubeLink;
|
||||
private CustomWebview webView;
|
||||
public static List<String> trackingDomains;
|
||||
private Menu defaultMenu;
|
||||
private MastalabWebViewClient mastalabWebViewClient;
|
||||
|
||||
|
|
|
@ -23,12 +23,6 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -43,18 +37,22 @@ import android.widget.ProgressBar;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import app.fedilab.android.client.HttpsConnection;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.webview.CustomWebview;
|
||||
import app.fedilab.android.webview.ProxyHelper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 24/04/2017.
|
||||
|
@ -69,6 +67,23 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
private String instance;
|
||||
private UpdateAccountInfoAsyncTask.SOCIAL social;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void clearCookies(Context context) {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
CookieManager.getInstance().flush();
|
||||
} else {
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context);
|
||||
cookieSyncMngr.startSync();
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
cookieManager.removeAllCookie();
|
||||
cookieManager.removeSessionCookie();
|
||||
cookieSyncMngr.stopSync();
|
||||
cookieSyncMngr.sync();
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
|
@ -152,7 +167,7 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
super.shouldOverrideUrlLoading(view, url);
|
||||
if (url.contains(Helper.REDIRECT_CONTENT_WEB)) {
|
||||
String val[] = url.split("code=");
|
||||
String[] val = url.split("code=");
|
||||
if (val.length < 2) {
|
||||
Toasty.error(getApplicationContext(), getString(R.string.toast_code_error), Toast.LENGTH_LONG).show();
|
||||
Intent myIntent = new Intent(WebviewConnectActivity.this, LoginActivity.class);
|
||||
|
@ -201,7 +216,6 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
webView.loadUrl(LoginActivity.redirectUserToAuthorizeAndLogin(getApplicationContext(), social, clientId, instance));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView != null && webView.canGoBack()) {
|
||||
|
@ -211,7 +225,6 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
@ -220,21 +233,4 @@ public class WebviewConnectActivity extends BaseActivity {
|
|||
alert = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void clearCookies(Context context) {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
CookieManager.getInstance().flush();
|
||||
} else {
|
||||
CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context);
|
||||
cookieSyncMngr.startSync();
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
cookieManager.removeAllCookie();
|
||||
cookieManager.removeSessionCookie();
|
||||
cookieSyncMngr.stopSync();
|
||||
cookieSyncMngr.sync();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,10 +19,6 @@ import android.content.SharedPreferences;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
@ -31,11 +27,17 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.WhoToFollowAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -43,14 +45,10 @@ import app.fedilab.android.client.Entities.Error;
|
|||
import app.fedilab.android.client.Entities.TrunkAccount;
|
||||
import app.fedilab.android.drawers.WhoToFollowAccountsAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.asynctasks.ManageListsAsyncTask;
|
||||
import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.WhoToFollowAsyncTask;
|
||||
import app.fedilab.android.interfaces.OnListActionInterface;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.interfaces.OnRetrieveWhoToFollowInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,9 +51,9 @@ public class CreateMastodonAccountAsyncTask extends AsyncTask<Void, Void, Void>
|
|||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
if( type == RetrieveInstanceRegAsyncTask.instanceType.MASTODON) {
|
||||
if (type == RetrieveInstanceRegAsyncTask.instanceType.MASTODON) {
|
||||
apiResponse = new API(contextReference.get(), instance, null).createAccount(accountCreation);
|
||||
}else{
|
||||
} else {
|
||||
apiResponse = new PeertubeAPI(contextReference.get(), instance, null).createAccount(accountCreation);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -32,10 +32,10 @@ import java.util.List;
|
|||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.sqlite.DomainBlockDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
|
||||
/**
|
||||
* Created by NickFreeman on 11/05/2019.
|
||||
|
|
|
@ -32,21 +32,12 @@ import app.fedilab.android.interfaces.OnFilterActionInterface;
|
|||
|
||||
public class ManageFiltersAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
public enum action {
|
||||
GET_FILTER,
|
||||
GET_ALL_FILTER,
|
||||
CREATE_FILTER,
|
||||
DELETE_FILTER,
|
||||
UPDATE_FILTER,
|
||||
}
|
||||
|
||||
private OnFilterActionInterface listener;
|
||||
private APIResponse apiResponse;
|
||||
private int statusCode;
|
||||
private action apiAction;
|
||||
private WeakReference<Context> contextReference;
|
||||
private Filters filter;
|
||||
|
||||
public ManageFiltersAsyncTask(Context context, action apiAction, Filters filter, OnFilterActionInterface onFilterActionInterface) {
|
||||
contextReference = new WeakReference<>(context);
|
||||
this.listener = onFilterActionInterface;
|
||||
|
@ -54,7 +45,6 @@ public class ManageFiltersAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
this.apiAction = apiAction;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
if (apiAction == action.GET_ALL_FILTER) {
|
||||
|
@ -76,4 +66,12 @@ public class ManageFiltersAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onActionDone(this.apiAction, apiResponse, statusCode);
|
||||
}
|
||||
|
||||
public enum action {
|
||||
GET_FILTER,
|
||||
GET_ALL_FILTER,
|
||||
CREATE_FILTER,
|
||||
DELETE_FILTER,
|
||||
UPDATE_FILTER,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,18 +31,6 @@ import app.fedilab.android.interfaces.OnListActionInterface;
|
|||
|
||||
public class ManageListsAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
public enum action {
|
||||
GET_LIST,
|
||||
GET_LIST_TIMELINE,
|
||||
GET_LIST_ACCOUNT,
|
||||
CREATE_LIST,
|
||||
DELETE_LIST,
|
||||
UPDATE_LIST,
|
||||
ADD_USERS,
|
||||
DELETE_USERS,
|
||||
SEARCH_USER
|
||||
}
|
||||
|
||||
private OnListActionInterface listener;
|
||||
private APIResponse apiResponse;
|
||||
private int statusCode;
|
||||
|
@ -55,7 +43,6 @@ public class ManageListsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private String max_id, since_id;
|
||||
private int limit;
|
||||
private String search;
|
||||
|
||||
public ManageListsAsyncTask(Context context, action apiAction, String[] accountsId, String targetedId, String listId, String title, OnListActionInterface onListActionInterface) {
|
||||
contextReference = new WeakReference<>(context);
|
||||
this.listener = onListActionInterface;
|
||||
|
@ -112,4 +99,16 @@ public class ManageListsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onActionDone(this.apiAction, apiResponse, statusCode);
|
||||
}
|
||||
|
||||
public enum action {
|
||||
GET_LIST,
|
||||
GET_LIST_TIMELINE,
|
||||
GET_LIST_ACCOUNT,
|
||||
CREATE_LIST,
|
||||
DELETE_LIST,
|
||||
UPDATE_LIST,
|
||||
ADD_USERS,
|
||||
DELETE_USERS,
|
||||
SEARCH_USER
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.database.sqlite.SQLiteDatabase;
|
|||
import android.os.AsyncTask;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -39,17 +38,6 @@ import app.fedilab.android.sqlite.Sqlite;
|
|||
|
||||
public class ManagePlaylistsAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
public enum action {
|
||||
GET_PLAYLIST,
|
||||
GET_LIST_VIDEOS,
|
||||
CREATE_PLAYLIST,
|
||||
DELETE_PLAYLIST,
|
||||
UPDATE_PLAYLIST,
|
||||
ADD_VIDEOS,
|
||||
DELETE_VIDEOS,
|
||||
GET_PLAYLIST_FOR_VIDEO,
|
||||
}
|
||||
|
||||
private OnPlaylistActionInterface listener;
|
||||
private APIResponse apiResponse;
|
||||
private int statusCode;
|
||||
|
@ -58,7 +46,6 @@ public class ManagePlaylistsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private String max_id;
|
||||
private Playlist playlist;
|
||||
private String videoId;
|
||||
|
||||
public ManagePlaylistsAsyncTask(Context context, action apiAction, Playlist playlist, String videoId, String max_id, OnPlaylistActionInterface onPlaylistActionInterface) {
|
||||
contextReference = new WeakReference<>(context);
|
||||
this.listener = onPlaylistActionInterface;
|
||||
|
@ -68,7 +55,6 @@ public class ManagePlaylistsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
this.videoId = videoId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
SharedPreferences sharedpreferences = contextReference.get().getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
@ -97,4 +83,15 @@ public class ManagePlaylistsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onActionDone(this.apiAction, apiResponse, statusCode);
|
||||
}
|
||||
|
||||
public enum action {
|
||||
GET_PLAYLIST,
|
||||
GET_LIST_VIDEOS,
|
||||
CREATE_PLAYLIST,
|
||||
DELETE_PLAYLIST,
|
||||
UPDATE_PLAYLIST,
|
||||
ADD_VIDEOS,
|
||||
DELETE_VIDEOS,
|
||||
GET_PLAYLIST_FOR_VIDEO,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,11 +39,6 @@ public class ManagePollAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private Poll poll;
|
||||
private type_s type;
|
||||
|
||||
public enum type_s {
|
||||
SUBMIT,
|
||||
REFRESH
|
||||
}
|
||||
|
||||
public ManagePollAsyncTask(Context context, type_s type, app.fedilab.android.client.Entities.Status status, int[] choices, OnPollInterface onPollInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.listener = onPollInterface;
|
||||
|
@ -75,4 +70,9 @@ public class ManagePollAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onPoll(status, poll);
|
||||
}
|
||||
|
||||
public enum type_s {
|
||||
SUBMIT,
|
||||
REFRESH
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,16 +22,15 @@ import android.os.SystemClock;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.client.Entities.StoredStatus;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
|
@ -186,12 +185,12 @@ public class PostActionAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
api.scheduledAction("PUT", storedStatus.getStatus(), null, storedStatus.getScheduledServerdId());
|
||||
} else if (apiAction == API.StatusAction.DELETESCHEDULED) {
|
||||
api.scheduledAction("DELETE", null, null, storedStatus.getScheduledServerdId());
|
||||
} else if (apiAction == API.StatusAction.MUTE_NOTIFICATIONS){
|
||||
} else if (apiAction == API.StatusAction.MUTE_NOTIFICATIONS) {
|
||||
statusCode = api.muteNotifications(targetedId, muteNotifications);
|
||||
} else if (apiAction == API.StatusAction.UNBOOKMARK && targetedId == null){
|
||||
} else if (apiAction == API.StatusAction.UNBOOKMARK && targetedId == null) {
|
||||
SQLiteDatabase db = Sqlite.getInstance(contextReference.get(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
List<app.fedilab.android.client.Entities.Status> bookmarks = new StatusCacheDAO(contextReference.get(), db).getAllStatus(StatusCacheDAO.BOOKMARK_CACHE);
|
||||
for (app.fedilab.android.client.Entities.Status status: bookmarks){
|
||||
for (app.fedilab.android.client.Entities.Status status : bookmarks) {
|
||||
statusCode = api.postAction(apiAction, status.getId());
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
|
@ -200,7 +199,7 @@ public class PostActionAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
}
|
||||
new StatusCacheDAO(contextReference.get(), db).removeAllStatus(StatusCacheDAO.BOOKMARK_CACHE);
|
||||
}else{
|
||||
} else {
|
||||
statusCode = api.postAction(apiAction, targetedId);
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +248,7 @@ public class PostActionAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
if( listener != null) {
|
||||
if (listener != null) {
|
||||
listener.onPostAction(statusCode, apiAction, targetedId, error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.lang.ref.WeakReference;
|
|||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.AdminAction;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnAdminActionInterface;
|
||||
|
||||
|
||||
|
|
|
@ -22,16 +22,16 @@ import java.lang.ref.WeakReference;
|
|||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnPostStatusActionInterface;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TagsCacheDAO;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.interfaces.OnPostStatusActionInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ public class PostStatusAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
apiResponse.setError(error);
|
||||
}
|
||||
}
|
||||
if( status.getIn_reply_to_id() != null){
|
||||
if (status.getIn_reply_to_id() != null) {
|
||||
apiResponse.setTargetedId(status.getIn_reply_to_id());
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ public class PostStatusAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
};
|
||||
thread.start();
|
||||
if( account != null) {
|
||||
if (account != null) {
|
||||
String key = account.getUsername() + "@" + account.getInstance();
|
||||
Helper.sleeps.put(key, 30000);
|
||||
Helper.startStreaming(contextReference.get());
|
||||
|
|
|
@ -19,12 +19,12 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountInterface;
|
||||
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountsInterface;
|
||||
|
||||
|
||||
|
@ -41,18 +41,6 @@ public class RetrieveAccountsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private WeakReference<Context> contextReference;
|
||||
private String instance, name;
|
||||
|
||||
public enum Type {
|
||||
BLOCKED,
|
||||
MUTED,
|
||||
FOLLOWING,
|
||||
FOLLOWERS,
|
||||
CHANNELS,
|
||||
REBLOGGED,
|
||||
FAVOURITED,
|
||||
SEARCH,
|
||||
GROUPS
|
||||
}
|
||||
|
||||
public RetrieveAccountsAsyncTask(Context context, String instance, String name, OnRetrieveAccountsInterface onRetrieveAccountsInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.instance = instance;
|
||||
|
@ -160,4 +148,16 @@ public class RetrieveAccountsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onRetrieveAccounts(apiResponse);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
BLOCKED,
|
||||
MUTED,
|
||||
FOLLOWING,
|
||||
FOLLOWERS,
|
||||
CHANNELS,
|
||||
REBLOGGED,
|
||||
FAVOURITED,
|
||||
SEARCH,
|
||||
GROUPS
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,9 +25,9 @@ import java.util.ArrayList;
|
|||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountsReplyInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountsReplyInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,11 +19,11 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveContextInterface;
|
||||
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ import java.lang.ref.WeakReference;
|
|||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.client.Entities.Emojis;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiInterface;
|
||||
import app.fedilab.android.sqlite.CustomEmojiDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.lang.ref.WeakReference;
|
|||
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsAfterBookmarkInterface;
|
||||
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ import android.content.Context;
|
|||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.ManageTimelines;
|
||||
|
@ -30,19 +30,16 @@ import app.fedilab.android.client.Entities.Peertube;
|
|||
import app.fedilab.android.client.Entities.RemoteInstance;
|
||||
import app.fedilab.android.client.Entities.Results;
|
||||
import app.fedilab.android.client.Entities.RetrieveFeedsParam;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.helper.FilterToots;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.PeertubeFavoritesDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusCacheDAO;
|
||||
import app.fedilab.android.sqlite.TimelineCacheDAO;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -70,62 +67,6 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private String currentfilter;
|
||||
private String social;
|
||||
|
||||
public enum Type {
|
||||
HOME,
|
||||
LOCAL,
|
||||
DIRECT,
|
||||
CONVERSATION,
|
||||
PUBLIC,
|
||||
HASHTAG,
|
||||
LIST,
|
||||
USER,
|
||||
FAVOURITES,
|
||||
ONESTATUS,
|
||||
CONTEXT,
|
||||
TAG,
|
||||
REMOTE_INSTANCE,
|
||||
REMOTE_INSTANCE_FILTERED,
|
||||
ART,
|
||||
PEERTUBE,
|
||||
NOTIFICATION,
|
||||
SEARCH,
|
||||
NEWS,
|
||||
|
||||
PSUBSCRIPTIONS,
|
||||
POVERVIEW,
|
||||
PTRENDING,
|
||||
PRECENTLYADDED,
|
||||
PMYVIDEOS,
|
||||
PLOCAL,
|
||||
CHANNEL,
|
||||
MYVIDEOS,
|
||||
PEERTUBE_HISTORY,
|
||||
|
||||
PIXELFED,
|
||||
PF_HOME,
|
||||
PF_LOCAL,
|
||||
PF_DISCOVER,
|
||||
PF_NOTIFICATION,
|
||||
PF_REPLIES,
|
||||
|
||||
|
||||
GNU_HOME,
|
||||
GNU_LOCAL,
|
||||
GNU_WHOLE,
|
||||
GNU_NOTIFICATION,
|
||||
GNU_DM,
|
||||
GNU_ART,
|
||||
GNU_TAG,
|
||||
GNU_GROUP_TIMELINE,
|
||||
|
||||
SCHEDULED_TOOTS,
|
||||
CACHE_BOOKMARKS,
|
||||
CACHE_BOOKMARKS_PEERTUBE,
|
||||
CACHE_STATUS,
|
||||
|
||||
}
|
||||
|
||||
|
||||
public RetrieveFeedsAsyncTask(Context context, FilterToots filterToots, String max_id, OnRetrieveFeedsInterface onRetrieveFeedsInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.action = Type.CACHE_STATUS;
|
||||
|
@ -142,6 +83,7 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
this.listener = onRetrieveFeedsInterface;
|
||||
}
|
||||
|
||||
|
||||
public RetrieveFeedsAsyncTask(Context context, Type action, String instanceName, String max_id, OnRetrieveFeedsInterface onRetrieveFeedsInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.action = action;
|
||||
|
@ -214,7 +156,6 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
this.remoteInstance = retrieveFeedsParam.getRemoteInstance();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
API api = new API(this.contextReference.get());
|
||||
|
@ -496,4 +437,59 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
protected void onPostExecute(Void result) {
|
||||
listener.onRetrieveFeeds(apiResponse);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
HOME,
|
||||
LOCAL,
|
||||
DIRECT,
|
||||
CONVERSATION,
|
||||
PUBLIC,
|
||||
HASHTAG,
|
||||
LIST,
|
||||
USER,
|
||||
FAVOURITES,
|
||||
ONESTATUS,
|
||||
CONTEXT,
|
||||
TAG,
|
||||
REMOTE_INSTANCE,
|
||||
REMOTE_INSTANCE_FILTERED,
|
||||
ART,
|
||||
PEERTUBE,
|
||||
NOTIFICATION,
|
||||
SEARCH,
|
||||
NEWS,
|
||||
|
||||
PSUBSCRIPTIONS,
|
||||
POVERVIEW,
|
||||
PTRENDING,
|
||||
PRECENTLYADDED,
|
||||
PMYVIDEOS,
|
||||
PLOCAL,
|
||||
CHANNEL,
|
||||
MYVIDEOS,
|
||||
PEERTUBE_HISTORY,
|
||||
|
||||
PIXELFED,
|
||||
PF_HOME,
|
||||
PF_LOCAL,
|
||||
PF_DISCOVER,
|
||||
PF_NOTIFICATION,
|
||||
PF_REPLIES,
|
||||
|
||||
|
||||
GNU_HOME,
|
||||
GNU_LOCAL,
|
||||
GNU_WHOLE,
|
||||
GNU_NOTIFICATION,
|
||||
GNU_DM,
|
||||
GNU_ART,
|
||||
GNU_TAG,
|
||||
GNU_GROUP_TIMELINE,
|
||||
|
||||
SCHEDULED_TOOTS,
|
||||
CACHE_BOOKMARKS,
|
||||
CACHE_BOOKMARKS_PEERTUBE,
|
||||
CACHE_STATUS,
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,11 +38,6 @@ public class RetrieveInstanceRegAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private String category;
|
||||
private instanceType type;
|
||||
|
||||
public enum instanceType{
|
||||
MASTODON,
|
||||
PEERTUBE
|
||||
}
|
||||
|
||||
public RetrieveInstanceRegAsyncTask(Context context, instanceType type, String category, OnRetrieveInstanceInterface onRetrieveInstanceInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.listener = onRetrieveInstanceInterface;
|
||||
|
@ -52,9 +47,9 @@ public class RetrieveInstanceRegAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
if( type == instanceType.MASTODON) {
|
||||
if (type == instanceType.MASTODON) {
|
||||
apiResponse = new API(this.contextReference.get()).getInstanceReg(category);
|
||||
}else if( type == instanceType.PEERTUBE){
|
||||
} else if (type == instanceType.PEERTUBE) {
|
||||
apiResponse = new PeertubeAPI(this.contextReference.get()).getInstanceReg();
|
||||
}
|
||||
return null;
|
||||
|
@ -65,4 +60,9 @@ public class RetrieveInstanceRegAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onRetrieveInstance(apiResponse);
|
||||
}
|
||||
|
||||
public enum instanceType {
|
||||
MASTODON,
|
||||
PEERTUBE
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ import android.os.AsyncTask;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveManyRelationshipsInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.lang.ref.WeakReference;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
@ -29,11 +30,10 @@ import app.fedilab.android.client.Entities.Conversation;
|
|||
import app.fedilab.android.client.Entities.ManageTimelines;
|
||||
import app.fedilab.android.client.Entities.TagTimeline;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.interfaces.OnRetrieveMissingFeedsInterface;
|
||||
import app.fedilab.android.sqlite.SearchDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveMissingFeedsInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,12 +20,12 @@ import android.os.AsyncTask;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Notification;
|
||||
import app.fedilab.android.fragments.DisplayNotificationsFragment;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveMissingNotificationsInterface;
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class RetrieveMissingNotificationsAsyncTask extends AsyncTask<Void, Void,
|
|||
protected Void doInBackground(Void... params) {
|
||||
API api = new API(this.contextReference.get());
|
||||
APIResponse apiResponse = api.getNotificationsSince(type, since_id, 40, false);
|
||||
if( apiResponse == null){
|
||||
if (apiResponse == null) {
|
||||
error = new Error();
|
||||
error.setError("");
|
||||
return null;
|
||||
|
|
|
@ -19,13 +19,13 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.fragments.DisplayNotificationsFragment;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveNotificationsInterface;
|
||||
|
||||
|
||||
|
|
|
@ -38,11 +38,6 @@ public class RetrieveOpenCollectiveAsyncTask extends AsyncTask<Void, Void, Void>
|
|||
private WeakReference<Context> contextReference;
|
||||
private Type type;
|
||||
|
||||
public enum Type {
|
||||
BACKERS,
|
||||
SPONSORS
|
||||
}
|
||||
|
||||
public RetrieveOpenCollectiveAsyncTask(Context context, Type type, OnRetrieveRemoteAccountInterface onRetrieveRemoteAccountInterface) {
|
||||
this.type = type;
|
||||
this.listener = onRetrieveRemoteAccountInterface;
|
||||
|
@ -61,4 +56,9 @@ public class RetrieveOpenCollectiveAsyncTask extends AsyncTask<Void, Void, Void>
|
|||
listener.onRetrieveRemoteAccount(results);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
BACKERS,
|
||||
SPONSORS
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,9 +25,9 @@ import app.fedilab.android.client.APIResponse;
|
|||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,8 +32,8 @@ import app.fedilab.android.client.PeertubeAPI;
|
|||
public class RetrievePeertubeInformationAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
|
||||
private WeakReference<Context> contextReference;
|
||||
public static PeertubeInformation peertubeInformation;
|
||||
private WeakReference<Context> contextReference;
|
||||
|
||||
|
||||
public RetrievePeertubeInformationAsyncTask(Context context) {
|
||||
|
|
|
@ -20,11 +20,11 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrievePeertubeInterface;
|
||||
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ import android.os.AsyncTask;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Relationship;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveRelationshipInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,12 +29,12 @@ import java.util.Set;
|
|||
import app.fedilab.android.client.Entities.StoredStatus;
|
||||
import app.fedilab.android.fragments.DisplayScheduledTootsFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveScheduledTootsInterface;
|
||||
import app.fedilab.android.jobs.ScheduledBoostsSyncJob;
|
||||
import app.fedilab.android.jobs.ScheduledTootsSyncJob;
|
||||
import app.fedilab.android.sqlite.BoostScheduleDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.StatusStoredDAO;
|
||||
import app.fedilab.android.interfaces.OnRetrieveScheduledTootsInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,16 +21,16 @@ import android.os.AsyncTask;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.InstanceNodeInfo;
|
||||
import app.fedilab.android.client.Entities.Results;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveSearchInterface;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TagsCacheDAO;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnRetrieveSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,27 +36,20 @@ import app.fedilab.android.sqlite.StatusCacheDAO;
|
|||
|
||||
public class SyncBookmarksAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
public enum sync{
|
||||
EXPORT,
|
||||
IMPORT
|
||||
}
|
||||
|
||||
private List<app.fedilab.android.client.Entities.Status> statusList;
|
||||
private OnSyncBookmarksInterface listener;
|
||||
private WeakReference<Context> contextReference;
|
||||
private sync type;
|
||||
|
||||
public SyncBookmarksAsyncTask(Context context, sync type, OnSyncBookmarksInterface onSyncBookmarksInterface) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.type = type;
|
||||
this.listener = onSyncBookmarksInterface;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
SQLiteDatabase db = Sqlite.getInstance(contextReference.get(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
if( type == sync.IMPORT){
|
||||
if (type == sync.IMPORT) {
|
||||
String max_id = null;
|
||||
do {
|
||||
APIResponse apiResponse = new API(contextReference.get()).getBookmarks(max_id);
|
||||
|
@ -64,7 +57,7 @@ public class SyncBookmarksAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
List<app.fedilab.android.client.Entities.Status> statuses = apiResponse.getStatuses();
|
||||
for (app.fedilab.android.client.Entities.Status tmpStatus : statuses) {
|
||||
app.fedilab.android.client.Entities.Status status = new StatusCacheDAO(contextReference.get(), db).getStatus(StatusCacheDAO.BOOKMARK_CACHE, tmpStatus.getId());
|
||||
if( status == null) {
|
||||
if (status == null) {
|
||||
new StatusCacheDAO(contextReference.get(), db).insertStatus(StatusCacheDAO.BOOKMARK_CACHE, tmpStatus);
|
||||
}
|
||||
}
|
||||
|
@ -74,9 +67,9 @@ public class SyncBookmarksAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
SystemClock.sleep(200);
|
||||
}
|
||||
} while (max_id != null);
|
||||
}else{
|
||||
} else {
|
||||
List<app.fedilab.android.client.Entities.Status> statuses = new StatusCacheDAO(contextReference.get(), db).getAllStatus(StatusCacheDAO.BOOKMARK_CACHE);
|
||||
if( statuses != null) {
|
||||
if (statuses != null) {
|
||||
for (app.fedilab.android.client.Entities.Status tmpStatus : statuses) {
|
||||
new API(contextReference.get()).postAction(API.StatusAction.BOOKMARK, tmpStatus.getId());
|
||||
try {
|
||||
|
@ -96,4 +89,9 @@ public class SyncBookmarksAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
listener.onRetrieveBookmarks(statusList);
|
||||
}
|
||||
|
||||
public enum sync {
|
||||
EXPORT,
|
||||
IMPORT
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,19 +25,18 @@ import java.util.Date;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.ManageTimelines;
|
||||
import app.fedilab.android.client.Entities.RemoteInstance;
|
||||
import app.fedilab.android.client.Entities.TagTimeline;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnSyncTimelineInterface;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.SearchDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.interfaces.OnSyncTimelineInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -252,7 +251,7 @@ public class SyncTimelinesAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
}
|
||||
|
||||
if( this.syncLists ) {
|
||||
if (this.syncLists) {
|
||||
APIResponse apiResponse;
|
||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
List<app.fedilab.android.client.Entities.List> listsAPI;
|
||||
|
@ -338,7 +337,7 @@ public class SyncTimelinesAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
String instance = Helper.getLiveInstance(contextReference.get());
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.LAST_DATE_LIST_FETCH+userId+instance, Helper.dateToString(new Date()));
|
||||
editor.putString(Helper.LAST_DATE_LIST_FETCH + userId + instance, Helper.dateToString(new Date()));
|
||||
editor.apply();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.InstanceNodeInfo;
|
||||
|
@ -33,7 +34,6 @@ import app.fedilab.android.client.PeertubeAPI;
|
|||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 23/04/2017.
|
||||
|
@ -47,15 +47,6 @@ public class UpdateAccountInfoAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
private WeakReference<Context> contextReference;
|
||||
private SOCIAL social;
|
||||
|
||||
public enum SOCIAL {
|
||||
MASTODON,
|
||||
PEERTUBE,
|
||||
PIXELFED,
|
||||
PLEROMA,
|
||||
GNU,
|
||||
FRIENDICA
|
||||
}
|
||||
|
||||
public UpdateAccountInfoAsyncTask(Context context, String token, String client_id, String client_secret, String refresh_token, String instance, SOCIAL social) {
|
||||
this.contextReference = new WeakReference<>(context);
|
||||
this.token = token;
|
||||
|
@ -69,7 +60,7 @@ public class UpdateAccountInfoAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
Account account;
|
||||
if( this.contextReference == null){
|
||||
if (this.contextReference == null) {
|
||||
return null;
|
||||
}
|
||||
if (social == SOCIAL.MASTODON || social == SOCIAL.PIXELFED || social == SOCIAL.PLEROMA) {
|
||||
|
@ -128,4 +119,13 @@ public class UpdateAccountInfoAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
|
||||
}
|
||||
|
||||
public enum SOCIAL {
|
||||
MASTODON,
|
||||
PEERTUBE,
|
||||
PIXELFED,
|
||||
PLEROMA,
|
||||
GNU,
|
||||
FRIENDICA
|
||||
}
|
||||
|
||||
}
|
|
@ -28,10 +28,10 @@ import app.fedilab.android.client.Entities.Emojis;
|
|||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.PeertubeAPI;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface;
|
||||
import app.fedilab.android.sqlite.AccountDAO;
|
||||
import app.fedilab.android.sqlite.CustomEmojiDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 17/05/2017.
|
||||
|
@ -58,7 +58,7 @@ public class UpdateAccountInfoByIDAsyncTask extends AsyncTask<Void, Void, Void>
|
|||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, null);
|
||||
Account account = null;
|
||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED )
|
||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED)
|
||||
account = new API(this.contextReference.get()).verifyCredentials();
|
||||
else if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
||||
account = new PeertubeAPI(this.contextReference.get()).verifyCredentials();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,6 @@ package app.fedilab.android.client;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
|
|
|
@ -30,14 +30,14 @@ public class CustomSharingResponse {
|
|||
return error;
|
||||
}
|
||||
|
||||
public String getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
public void setError(Error error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public String getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
public void setResponse(String response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
|
|
@ -25,12 +25,6 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import android.text.Html;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
|
@ -44,6 +38,10 @@ import android.util.Patterns;
|
|||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
@ -64,19 +62,16 @@ import java.util.Map;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.HashTagActivity;
|
||||
import app.fedilab.android.activities.ShowAccountActivity;
|
||||
import app.fedilab.android.helper.CrossActions;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveEmojiAccountInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
|
||||
import static app.fedilab.android.helper.Helper.THEME_BLACK;
|
||||
import static app.fedilab.android.helper.Helper.THEME_DARK;
|
||||
import static app.fedilab.android.helper.Helper.THEME_LIGHT;
|
||||
import static app.fedilab.android.helper.Helper.drawableToBitmap;
|
||||
import static app.fedilab.android.helper.Helper.hashtagPattern;
|
||||
|
||||
|
@ -88,6 +83,17 @@ import static app.fedilab.android.helper.Helper.hashtagPattern;
|
|||
|
||||
public class Account implements Parcelable {
|
||||
|
||||
public static final Creator<Account> CREATOR = new Creator<Account>() {
|
||||
@Override
|
||||
public Account createFromParcel(Parcel source) {
|
||||
return new Account(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account[] newArray(int size) {
|
||||
return new Account[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String uuid;
|
||||
private String username;
|
||||
|
@ -133,73 +139,12 @@ public class Account implements Parcelable {
|
|||
private boolean isAdmin = false;
|
||||
private String privacy = "public";
|
||||
private boolean sensitive = false;
|
||||
|
||||
private String locale;
|
||||
private String invite_request;
|
||||
private String created_by_application_id;
|
||||
private String invited_by_account_id;
|
||||
private boolean emojiFound = false;
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.id);
|
||||
dest.writeString(this.uuid);
|
||||
dest.writeString(this.username);
|
||||
TextUtils.writeToParcel(this.displayNameSpan, dest, flags);
|
||||
dest.writeString(this.acct);
|
||||
dest.writeString(this.display_name);
|
||||
dest.writeString(this.stored_displayname);
|
||||
dest.writeByte(this.locked ? (byte) 1 : (byte) 0);
|
||||
dest.writeLong(this.created_at != null ? this.created_at.getTime() : -1);
|
||||
dest.writeLong(this.updated_at != null ? this.updated_at.getTime() : -1);
|
||||
dest.writeInt(this.followers_count);
|
||||
dest.writeInt(this.following_count);
|
||||
dest.writeInt(this.statuses_count);
|
||||
dest.writeString(this.followers_count_str);
|
||||
dest.writeString(this.following_count_str);
|
||||
dest.writeString(this.statuses_count_str);
|
||||
dest.writeString(this.note);
|
||||
TextUtils.writeToParcel(this.noteSpan, dest, flags);
|
||||
dest.writeString(this.url);
|
||||
dest.writeString(this.avatar);
|
||||
dest.writeString(this.avatar_static);
|
||||
dest.writeString(this.header);
|
||||
dest.writeString(this.header_static);
|
||||
dest.writeString(this.token);
|
||||
dest.writeString(this.instance);
|
||||
dest.writeByte(this.isFollowing ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.followType == null ? -1 : this.followType.ordinal());
|
||||
dest.writeByte(this.isMakingAction ? (byte) 1 : (byte) 0);
|
||||
dest.writeParcelable(this.moved_to_account, flags);
|
||||
dest.writeByte(this.muting_notifications ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.metaDataSize);
|
||||
dest.writeInt(this.metaDataSizeVerified);
|
||||
dest.writeSerializable(this.fields);
|
||||
dest.writeSerializable(this.fieldsVerified);
|
||||
dest.writeSerializable(this.fieldsSpan);
|
||||
dest.writeTypedList(this.emojis);
|
||||
dest.writeString(this.host);
|
||||
dest.writeByte(this.isBot ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.social);
|
||||
dest.writeString(this.client_id);
|
||||
dest.writeString(this.client_secret);
|
||||
dest.writeString(this.refresh_token);
|
||||
dest.writeByte(this.isModerator ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isAdmin ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.privacy);
|
||||
dest.writeByte(this.sensitive ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.locale);
|
||||
dest.writeString(this.invite_request);
|
||||
dest.writeString(this.created_by_application_id);
|
||||
dest.writeString(this.invited_by_account_id);
|
||||
}
|
||||
|
||||
public Account() {
|
||||
}
|
||||
|
||||
|
@ -259,17 +204,125 @@ public class Account implements Parcelable {
|
|||
this.invited_by_account_id = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<Account> CREATOR = new Creator<Account>() {
|
||||
@Override
|
||||
public Account createFromParcel(Parcel source) {
|
||||
return new Account(source);
|
||||
}
|
||||
public static void makeAccountNameEmoji(final Context context, final OnRetrieveEmojiAccountInterface listener, Account account) {
|
||||
if (((Activity) context).isFinishing())
|
||||
return;
|
||||
|
||||
@Override
|
||||
public Account[] newArray(int size) {
|
||||
return new Account[size];
|
||||
account.setdisplayNameSpan(new SpannableString(account.getDisplay_name()));
|
||||
SpannableString displayNameSpan = account.getdisplayNameSpan();
|
||||
if (displayNameSpan == null)
|
||||
return;
|
||||
final List<Emojis> emojis = account.getEmojis();
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
|
||||
if (emojis != null && emojis.size() > 0) {
|
||||
final int[] i = {0};
|
||||
for (final Emojis emoji : emojis) {
|
||||
try {
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(emoji.getUrl())
|
||||
.into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
final String targetedEmoji = ":" + emoji.getShortcode() + ":";
|
||||
if (displayNameSpan.toString().contains(targetedEmoji)) {
|
||||
//emojis can be used several times so we have to loop
|
||||
for (int startPosition = -1; (startPosition = displayNameSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
|
||||
final int endPosition = startPosition + targetedEmoji.length();
|
||||
if (endPosition <= displayNameSpan.toString().length() && endPosition >= startPosition) {
|
||||
ImageSpan imageSpan;
|
||||
if (!disableAnimatedEmoji) {
|
||||
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
|
||||
resource.setVisible(true, true);
|
||||
imageSpan = new ImageSpan(resource);
|
||||
} else {
|
||||
Bitmap bitmap = drawableToBitmap(resource.getCurrent());
|
||||
imageSpan = new ImageSpan(context,
|
||||
Bitmap.createScaledBitmap(bitmap, (int) Helper.convertDpToPixel(20, context),
|
||||
(int) Helper.convertDpToPixel(20, context), false));
|
||||
}
|
||||
displayNameSpan.setSpan(
|
||||
imageSpan, startPosition,
|
||||
endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
i[0]++;
|
||||
if (i[0] == (emojis.size())) {
|
||||
account.setdisplayNameSpan(displayNameSpan);
|
||||
if (listener != null)
|
||||
listener.onRetrieveEmojiAccount(account);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.id);
|
||||
dest.writeString(this.uuid);
|
||||
dest.writeString(this.username);
|
||||
TextUtils.writeToParcel(this.displayNameSpan, dest, flags);
|
||||
dest.writeString(this.acct);
|
||||
dest.writeString(this.display_name);
|
||||
dest.writeString(this.stored_displayname);
|
||||
dest.writeByte(this.locked ? (byte) 1 : (byte) 0);
|
||||
dest.writeLong(this.created_at != null ? this.created_at.getTime() : -1);
|
||||
dest.writeLong(this.updated_at != null ? this.updated_at.getTime() : -1);
|
||||
dest.writeInt(this.followers_count);
|
||||
dest.writeInt(this.following_count);
|
||||
dest.writeInt(this.statuses_count);
|
||||
dest.writeString(this.followers_count_str);
|
||||
dest.writeString(this.following_count_str);
|
||||
dest.writeString(this.statuses_count_str);
|
||||
dest.writeString(this.note);
|
||||
TextUtils.writeToParcel(this.noteSpan, dest, flags);
|
||||
dest.writeString(this.url);
|
||||
dest.writeString(this.avatar);
|
||||
dest.writeString(this.avatar_static);
|
||||
dest.writeString(this.header);
|
||||
dest.writeString(this.header_static);
|
||||
dest.writeString(this.token);
|
||||
dest.writeString(this.instance);
|
||||
dest.writeByte(this.isFollowing ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.followType == null ? -1 : this.followType.ordinal());
|
||||
dest.writeByte(this.isMakingAction ? (byte) 1 : (byte) 0);
|
||||
dest.writeParcelable(this.moved_to_account, flags);
|
||||
dest.writeByte(this.muting_notifications ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.metaDataSize);
|
||||
dest.writeInt(this.metaDataSizeVerified);
|
||||
dest.writeSerializable(this.fields);
|
||||
dest.writeSerializable(this.fieldsVerified);
|
||||
dest.writeSerializable(this.fieldsSpan);
|
||||
dest.writeTypedList(this.emojis);
|
||||
dest.writeString(this.host);
|
||||
dest.writeByte(this.isBot ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.social);
|
||||
dest.writeString(this.client_id);
|
||||
dest.writeString(this.client_secret);
|
||||
dest.writeString(this.refresh_token);
|
||||
dest.writeByte(this.isModerator ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isAdmin ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.privacy);
|
||||
dest.writeByte(this.sensitive ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.locale);
|
||||
dest.writeString(this.invite_request);
|
||||
dest.writeString(this.created_by_application_id);
|
||||
dest.writeString(this.invited_by_account_id);
|
||||
}
|
||||
|
||||
public followAction getFollowType() {
|
||||
return followType;
|
||||
|
@ -303,23 +356,22 @@ public class Account implements Parcelable {
|
|||
this.muting_notifications = muting_notifications;
|
||||
}
|
||||
|
||||
public void setFields(LinkedHashMap<String, String> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public void setFieldsSpan(LinkedHashMap<SpannableString, SpannableString> fieldsSpan) {
|
||||
this.fieldsSpan = fieldsSpan;
|
||||
public void setFields(LinkedHashMap<String, String> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
|
||||
public LinkedHashMap<SpannableString, SpannableString> getFieldsSpan() {
|
||||
return fieldsSpan;
|
||||
}
|
||||
|
||||
public void setFieldsSpan(LinkedHashMap<SpannableString, SpannableString> fieldsSpan) {
|
||||
this.fieldsSpan = fieldsSpan;
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, Boolean> getFieldsVerified() {
|
||||
return fieldsVerified;
|
||||
}
|
||||
|
@ -472,17 +524,6 @@ public class Account implements Parcelable {
|
|||
this.emojiFound = emojiFound;
|
||||
}
|
||||
|
||||
|
||||
public enum followAction {
|
||||
FOLLOW,
|
||||
NOT_FOLLOW,
|
||||
BLOCK,
|
||||
MUTE,
|
||||
REQUEST_SENT,
|
||||
NOTHING
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -725,7 +766,7 @@ public class Account implements Parcelable {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
int l_c = prefs.getInt("theme_link_color", -1);
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
if( l_c == -1) {
|
||||
if (l_c == -1) {
|
||||
l_c = ThemeHelper.getAttColor(context, R.attr.linkColor);
|
||||
}
|
||||
final int link_color = l_c;
|
||||
|
@ -1055,72 +1096,19 @@ public class Account implements Parcelable {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public static void makeAccountNameEmoji(final Context context, final OnRetrieveEmojiAccountInterface listener, Account account) {
|
||||
if (((Activity) context).isFinishing())
|
||||
return;
|
||||
|
||||
account.setdisplayNameSpan(new SpannableString(account.getDisplay_name()));
|
||||
SpannableString displayNameSpan = account.getdisplayNameSpan();
|
||||
if (displayNameSpan == null)
|
||||
return;
|
||||
final List<Emojis> emojis = account.getEmojis();
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
|
||||
if (emojis != null && emojis.size() > 0) {
|
||||
final int[] i = {0};
|
||||
for (final Emojis emoji : emojis) {
|
||||
try {
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(emoji.getUrl())
|
||||
.into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
final String targetedEmoji = ":" + emoji.getShortcode() + ":";
|
||||
if (displayNameSpan.toString().contains(targetedEmoji)) {
|
||||
//emojis can be used several times so we have to loop
|
||||
for (int startPosition = -1; (startPosition = displayNameSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
|
||||
final int endPosition = startPosition + targetedEmoji.length();
|
||||
if (endPosition <= displayNameSpan.toString().length() && endPosition >= startPosition) {
|
||||
ImageSpan imageSpan;
|
||||
if (!disableAnimatedEmoji) {
|
||||
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
|
||||
resource.setVisible(true, true);
|
||||
imageSpan = new ImageSpan(resource);
|
||||
} else {
|
||||
Bitmap bitmap = drawableToBitmap(resource.getCurrent());
|
||||
imageSpan = new ImageSpan(context,
|
||||
Bitmap.createScaledBitmap(bitmap, (int) Helper.convertDpToPixel(20, context),
|
||||
(int) Helper.convertDpToPixel(20, context), false));
|
||||
}
|
||||
displayNameSpan.setSpan(
|
||||
imageSpan, startPosition,
|
||||
endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
i[0]++;
|
||||
if (i[0] == (emojis.size())) {
|
||||
account.setdisplayNameSpan(displayNameSpan);
|
||||
if (listener != null)
|
||||
listener.onRetrieveEmojiAccount(account);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String toString() {
|
||||
return this.getAcct() + " - " + this.getUrl();
|
||||
}
|
||||
|
||||
public enum followAction {
|
||||
FOLLOW,
|
||||
NOT_FOLLOW,
|
||||
BLOCK,
|
||||
MUTE,
|
||||
REQUEST_SENT,
|
||||
NOTHING
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,17 @@ import app.fedilab.android.client.API;
|
|||
|
||||
public class AccountAdmin implements Parcelable {
|
||||
|
||||
public static final Creator<AccountAdmin> CREATOR = new Creator<AccountAdmin>() {
|
||||
@Override
|
||||
public AccountAdmin createFromParcel(Parcel source) {
|
||||
return new AccountAdmin(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountAdmin[] newArray(int size) {
|
||||
return new AccountAdmin[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String username;
|
||||
private Date created_at;
|
||||
|
@ -38,6 +49,28 @@ public class AccountAdmin implements Parcelable {
|
|||
private API.adminAction action;
|
||||
private boolean approved;
|
||||
|
||||
public AccountAdmin() {
|
||||
}
|
||||
|
||||
protected AccountAdmin(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.username = in.readString();
|
||||
long tmpCreated_at = in.readLong();
|
||||
this.created_at = tmpCreated_at == -1 ? null : new Date(tmpCreated_at);
|
||||
this.email = in.readString();
|
||||
this.role = in.readString();
|
||||
this.ip = in.readString();
|
||||
this.domain = in.readString();
|
||||
this.confirmed = in.readByte() != 0;
|
||||
this.suspended = in.readByte() != 0;
|
||||
this.silenced = in.readByte() != 0;
|
||||
this.disabled = in.readByte() != 0;
|
||||
this.account = in.readParcelable(Account.class.getClassLoader());
|
||||
int tmpAction = in.readInt();
|
||||
this.action = tmpAction == -1 ? null : API.adminAction.values()[tmpAction];
|
||||
this.approved = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -126,10 +159,6 @@ public class AccountAdmin implements Parcelable {
|
|||
this.account = account;
|
||||
}
|
||||
|
||||
|
||||
public AccountAdmin() {
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
@ -176,35 +205,4 @@ public class AccountAdmin implements Parcelable {
|
|||
dest.writeInt(this.action == null ? -1 : this.action.ordinal());
|
||||
dest.writeByte(this.approved ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
protected AccountAdmin(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.username = in.readString();
|
||||
long tmpCreated_at = in.readLong();
|
||||
this.created_at = tmpCreated_at == -1 ? null : new Date(tmpCreated_at);
|
||||
this.email = in.readString();
|
||||
this.role = in.readString();
|
||||
this.ip = in.readString();
|
||||
this.domain = in.readString();
|
||||
this.confirmed = in.readByte() != 0;
|
||||
this.suspended = in.readByte() != 0;
|
||||
this.silenced = in.readByte() != 0;
|
||||
this.disabled = in.readByte() != 0;
|
||||
this.account = in.readParcelable(Account.class.getClassLoader());
|
||||
int tmpAction = in.readInt();
|
||||
this.action = tmpAction == -1 ? null : API.adminAction.values()[tmpAction];
|
||||
this.approved = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Creator<AccountAdmin> CREATOR = new Creator<AccountAdmin>() {
|
||||
@Override
|
||||
public AccountAdmin createFromParcel(Parcel source) {
|
||||
return new AccountAdmin(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountAdmin[] newArray(int size) {
|
||||
return new AccountAdmin[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,17 +25,6 @@ import android.os.Parcelable;
|
|||
|
||||
public class Application implements Parcelable {
|
||||
|
||||
private String name;
|
||||
private String website;
|
||||
|
||||
public Application() {
|
||||
}
|
||||
|
||||
protected Application(Parcel in) {
|
||||
name = in.readString();
|
||||
website = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<Application> CREATOR = new Creator<Application>() {
|
||||
@Override
|
||||
public Application createFromParcel(Parcel in) {
|
||||
|
@ -47,6 +36,16 @@ public class Application implements Parcelable {
|
|||
return new Application[size];
|
||||
}
|
||||
};
|
||||
private String name;
|
||||
private String website;
|
||||
|
||||
public Application() {
|
||||
}
|
||||
|
||||
protected Application(Parcel in) {
|
||||
name = in.readString();
|
||||
website = in.readString();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
|
@ -24,6 +24,17 @@ import android.os.Parcelable;
|
|||
|
||||
public class Attachment implements Parcelable {
|
||||
|
||||
public static final Creator<Attachment> CREATOR = new Creator<Attachment>() {
|
||||
@Override
|
||||
public Attachment createFromParcel(Parcel in) {
|
||||
return new Attachment(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Attachment[] newArray(int size) {
|
||||
return new Attachment[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String type;
|
||||
private String url;
|
||||
|
@ -43,18 +54,6 @@ public class Attachment implements Parcelable {
|
|||
description = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<Attachment> CREATOR = new Creator<Attachment>() {
|
||||
@Override
|
||||
public Attachment createFromParcel(Parcel in) {
|
||||
return new Attachment(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Attachment[] newArray(int size) {
|
||||
return new Attachment[size];
|
||||
}
|
||||
};
|
||||
|
||||
public Attachment() {
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,17 @@ import android.os.Parcelable;
|
|||
|
||||
public class Card implements Parcelable {
|
||||
|
||||
public static final Creator<Card> CREATOR = new Creator<Card>() {
|
||||
@Override
|
||||
public Card createFromParcel(Parcel in) {
|
||||
return new Card(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Card[] newArray(int size) {
|
||||
return new Card[size];
|
||||
}
|
||||
};
|
||||
private String url;
|
||||
private String title;
|
||||
private String description;
|
||||
|
@ -44,18 +55,6 @@ public class Card implements Parcelable {
|
|||
public Card() {
|
||||
}
|
||||
|
||||
public static final Creator<Card> CREATOR = new Creator<Card>() {
|
||||
@Override
|
||||
public Card createFromParcel(Parcel in) {
|
||||
return new Card(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Card[] newArray(int size) {
|
||||
return new Card[size];
|
||||
}
|
||||
};
|
||||
|
||||
protected Card(Parcel in) {
|
||||
url = in.readString();
|
||||
title = in.readString();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package app.fedilab.android.client.Entities;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -25,6 +25,17 @@ import android.os.Parcelable;
|
|||
|
||||
public class Emojis implements Parcelable {
|
||||
|
||||
public static final Creator<Emojis> CREATOR = new Creator<Emojis>() {
|
||||
@Override
|
||||
public Emojis createFromParcel(Parcel source) {
|
||||
return new Emojis(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Emojis[] newArray(int size) {
|
||||
return new Emojis[size];
|
||||
}
|
||||
};
|
||||
private String shortcode;
|
||||
private String static_url;
|
||||
private String url;
|
||||
|
@ -35,6 +46,13 @@ public class Emojis implements Parcelable {
|
|||
public Emojis() {
|
||||
}
|
||||
|
||||
protected Emojis(Parcel in) {
|
||||
this.shortcode = in.readString();
|
||||
this.static_url = in.readString();
|
||||
this.url = in.readString();
|
||||
this.visible_in_picker = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public String getShortcode() {
|
||||
return shortcode;
|
||||
}
|
||||
|
@ -80,25 +98,6 @@ public class Emojis implements Parcelable {
|
|||
dest.writeByte(this.visible_in_picker ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
protected Emojis(Parcel in) {
|
||||
this.shortcode = in.readString();
|
||||
this.static_url = in.readString();
|
||||
this.url = in.readString();
|
||||
this.visible_in_picker = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Creator<Emojis> CREATOR = new Creator<Emojis>() {
|
||||
@Override
|
||||
public Emojis createFromParcel(Parcel source) {
|
||||
return new Emojis(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Emojis[] newArray(int size) {
|
||||
return new Emojis[size];
|
||||
}
|
||||
};
|
||||
|
||||
public Drawable getDrawable() {
|
||||
return drawable;
|
||||
}
|
||||
|
|
|
@ -25,9 +25,28 @@ import android.os.Parcelable;
|
|||
|
||||
public class List implements Parcelable {
|
||||
|
||||
public static final Parcelable.Creator<List> CREATOR = new Parcelable.Creator<List>() {
|
||||
@Override
|
||||
public List createFromParcel(Parcel source) {
|
||||
return new List(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List[] newArray(int size) {
|
||||
return new List[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String title;
|
||||
|
||||
public List() {
|
||||
}
|
||||
|
||||
protected List(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.title = in.readString();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -54,24 +73,4 @@ public class List implements Parcelable {
|
|||
dest.writeString(this.id);
|
||||
dest.writeString(this.title);
|
||||
}
|
||||
|
||||
public List() {
|
||||
}
|
||||
|
||||
protected List(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.title = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<List> CREATOR = new Parcelable.Creator<List>() {
|
||||
@Override
|
||||
public List createFromParcel(Parcel source) {
|
||||
return new List(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List[] newArray(int size) {
|
||||
return new List[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,22 +15,12 @@ package app.fedilab.android.client.Entities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -40,19 +30,22 @@ import android.view.View;
|
|||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.BaseMainActivity;
|
||||
import app.fedilab.android.activities.ListActivity;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
|
||||
|
@ -60,23 +53,24 @@ import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
|
|||
import app.fedilab.android.fragments.DisplayStatusFragment;
|
||||
import app.fedilab.android.fragments.TabLayoutNotificationsFragment;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.sqlite.InstancesDAO;
|
||||
import app.fedilab.android.sqlite.SearchDAO;
|
||||
import app.fedilab.android.sqlite.Sqlite;
|
||||
import app.fedilab.android.sqlite.TimelinesDAO;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.android.activities.BaseMainActivity.mPageReferenceMap;
|
||||
import static app.fedilab.android.helper.Helper.THEME_LIGHT;
|
||||
import static app.fedilab.android.sqlite.Sqlite.DB_NAME;
|
||||
|
||||
|
||||
public class ManageTimelines {
|
||||
|
||||
private static String userId;
|
||||
private static String instance;
|
||||
private int position;
|
||||
private int id;
|
||||
private boolean displayed;
|
||||
private Type type;
|
||||
private static String userId;
|
||||
private static String instance;
|
||||
private RemoteInstance remoteInstance;
|
||||
private TagTimeline tagTimeline;
|
||||
private List listTimeline;
|
||||
|
@ -85,89 +79,6 @@ public class ManageTimelines {
|
|||
|
||||
private boolean notif_follow, notif_add, notif_mention, notif_share, notif_poll;
|
||||
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public boolean isDisplayed() {
|
||||
return displayed;
|
||||
}
|
||||
|
||||
public void setDisplayed(boolean displayed) {
|
||||
this.displayed = displayed;
|
||||
}
|
||||
|
||||
public ManageTimelines.Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(ManageTimelines.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
|
||||
public String getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public RemoteInstance getRemoteInstance() {
|
||||
return remoteInstance;
|
||||
}
|
||||
|
||||
public void setRemoteInstance(RemoteInstance remoteInstance) {
|
||||
this.remoteInstance = remoteInstance;
|
||||
}
|
||||
|
||||
public TagTimeline getTagTimeline() {
|
||||
return tagTimeline;
|
||||
}
|
||||
|
||||
public void setTagTimeline(TagTimeline tagTimeline) {
|
||||
this.tagTimeline = tagTimeline;
|
||||
}
|
||||
|
||||
|
||||
public List getListTimeline() {
|
||||
return listTimeline;
|
||||
}
|
||||
|
||||
public void setListTimeline(List listTimeline) {
|
||||
this.listTimeline = listTimeline;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
HOME,
|
||||
DIRECT,
|
||||
NOTIFICATION,
|
||||
LOCAL,
|
||||
PUBLIC,
|
||||
ART,
|
||||
PEERTUBE,
|
||||
TAG,
|
||||
LIST,
|
||||
INSTANCE
|
||||
}
|
||||
|
||||
|
||||
public static Type typeFromDb(String value) {
|
||||
switch (value) {
|
||||
case "HOME":
|
||||
|
@ -220,7 +131,6 @@ public class ManageTimelines {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static RetrieveFeedsAsyncTask.Type transform(Context context, Type type) {
|
||||
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
|
@ -293,6 +203,69 @@ public class ManageTimelines {
|
|||
return null;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public boolean isDisplayed() {
|
||||
return displayed;
|
||||
}
|
||||
|
||||
public void setDisplayed(boolean displayed) {
|
||||
this.displayed = displayed;
|
||||
}
|
||||
|
||||
public ManageTimelines.Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(ManageTimelines.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public String getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public RemoteInstance getRemoteInstance() {
|
||||
return remoteInstance;
|
||||
}
|
||||
|
||||
public void setRemoteInstance(RemoteInstance remoteInstance) {
|
||||
this.remoteInstance = remoteInstance;
|
||||
}
|
||||
|
||||
public TagTimeline getTagTimeline() {
|
||||
return tagTimeline;
|
||||
}
|
||||
|
||||
public void setTagTimeline(TagTimeline tagTimeline) {
|
||||
this.tagTimeline = tagTimeline;
|
||||
}
|
||||
|
||||
public List getListTimeline() {
|
||||
return listTimeline;
|
||||
}
|
||||
|
||||
public void setListTimeline(List listTimeline) {
|
||||
this.listTimeline = listTimeline;
|
||||
}
|
||||
|
||||
public TabLayout createTabs(Context context, TabLayout tabLayout, java.util.List<ManageTimelines> manageTimelines) {
|
||||
|
||||
|
@ -417,7 +390,6 @@ public class ManageTimelines {
|
|||
return tabLayout;
|
||||
}
|
||||
|
||||
|
||||
private void notificationClik(Context context, ManageTimelines tl, TabLayout tabLayout) {
|
||||
final LinearLayout tabStrip = (LinearLayout) tabLayout.getChildAt(0);
|
||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
|
||||
|
@ -523,7 +495,6 @@ public class ManageTimelines {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private void manageFilters(Context context, ManageTimelines tl, LinearLayout tabStrip, int position) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
//Only shown if the tab has focus
|
||||
|
@ -740,7 +711,6 @@ public class ManageTimelines {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void tagClick(Context context, ManageTimelines tl, LinearLayout tabStrip, int position) {
|
||||
|
||||
|
||||
|
@ -961,7 +931,6 @@ public class ManageTimelines {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private void instanceClick(Context context, ManageTimelines tl, LinearLayout tabStrip, int position) {
|
||||
|
||||
|
||||
|
@ -1164,4 +1133,18 @@ public class ManageTimelines {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public enum Type {
|
||||
HOME,
|
||||
DIRECT,
|
||||
NOTIFICATION,
|
||||
LOCAL,
|
||||
PUBLIC,
|
||||
ART,
|
||||
PEERTUBE,
|
||||
TAG,
|
||||
LIST,
|
||||
INSTANCE
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,17 @@ import android.os.Parcelable;
|
|||
|
||||
public class Mention implements Parcelable {
|
||||
|
||||
public static final Creator<Mention> CREATOR = new Creator<Mention>() {
|
||||
@Override
|
||||
public Mention createFromParcel(Parcel in) {
|
||||
return new Mention(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mention[] newArray(int size) {
|
||||
return new Mention[size];
|
||||
}
|
||||
};
|
||||
private String url;
|
||||
private String username;
|
||||
private String acct;
|
||||
|
@ -39,18 +50,6 @@ public class Mention implements Parcelable {
|
|||
public Mention() {
|
||||
}
|
||||
|
||||
public static final Creator<Mention> CREATOR = new Creator<Mention>() {
|
||||
@Override
|
||||
public Mention createFromParcel(Parcel in) {
|
||||
return new Mention(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mention[] newArray(int size) {
|
||||
return new Mention[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
|
|
@ -19,18 +19,15 @@ import android.app.Activity;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ImageSpan;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
|
@ -60,6 +57,17 @@ import static app.fedilab.android.helper.Helper.drawableToBitmap;
|
|||
|
||||
public class Notification implements Parcelable {
|
||||
|
||||
public static final Creator<Notification> CREATOR = new Creator<Notification>() {
|
||||
@Override
|
||||
public Notification createFromParcel(Parcel in) {
|
||||
return new Notification(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Notification[] newArray(int size) {
|
||||
return new Notification[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String type;
|
||||
private Date created_at;
|
||||
|
@ -78,79 +86,6 @@ public class Notification implements Parcelable {
|
|||
public Notification() {
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public static final Creator<Notification> CREATOR = new Creator<Notification>() {
|
||||
@Override
|
||||
public Notification createFromParcel(Parcel in) {
|
||||
return new Notification(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Notification[] newArray(int size) {
|
||||
return new Notification[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Date getCreated_at() {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
public void setCreated_at(Date created_at) {
|
||||
this.created_at = created_at;
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(Account account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(id);
|
||||
dest.writeString(type);
|
||||
dest.writeParcelable(account, flags);
|
||||
dest.writeParcelable(status, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object otherNotifications) {
|
||||
return otherNotifications != null && (otherNotifications == this || otherNotifications instanceof Notification && this.getId().equals(((Notification) otherNotifications).getId()));
|
||||
}
|
||||
|
||||
|
||||
public static void makeEmojis(final Context context, final OnRetrieveEmojiInterface listener, Notification notification) {
|
||||
|
||||
if (((Activity) context).isFinishing())
|
||||
|
@ -173,7 +108,6 @@ public class Notification implements Parcelable {
|
|||
break;
|
||||
case "poll":
|
||||
typeString = context.getString(R.string.notif_poll);
|
||||
;
|
||||
break;
|
||||
case "reblog":
|
||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||
|
@ -345,6 +279,64 @@ public class Notification implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Date getCreated_at() {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
public void setCreated_at(Date created_at) {
|
||||
this.created_at = created_at;
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(Account account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(id);
|
||||
dest.writeString(type);
|
||||
dest.writeParcelable(account, flags);
|
||||
dest.writeParcelable(status, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object otherNotifications) {
|
||||
return otherNotifications != null && (otherNotifications == this || otherNotifications instanceof Notification && this.getId().equals(((Notification) otherNotifications).getId()));
|
||||
}
|
||||
|
||||
public boolean isNotificationAnimated() {
|
||||
return notificationAnimated;
|
||||
}
|
||||
|
|
|
@ -21,14 +21,6 @@ import java.util.LinkedHashMap;
|
|||
public class PeertubeInformation {
|
||||
|
||||
|
||||
private LinkedHashMap<Integer, String> categories;
|
||||
private LinkedHashMap<String, String> languages;
|
||||
private LinkedHashMap<Integer, String> licences;
|
||||
private LinkedHashMap<Integer, String> privacies;
|
||||
private LinkedHashMap<Integer, String> playlistPrivacies;
|
||||
private LinkedHashMap<String, String> translations;
|
||||
|
||||
|
||||
public static final LinkedHashMap<String, String> langueMapped;
|
||||
|
||||
static {
|
||||
|
@ -49,6 +41,12 @@ public class PeertubeInformation {
|
|||
langueMapped = aMap;
|
||||
}
|
||||
|
||||
private LinkedHashMap<Integer, String> categories;
|
||||
private LinkedHashMap<String, String> languages;
|
||||
private LinkedHashMap<Integer, String> licences;
|
||||
private LinkedHashMap<Integer, String> privacies;
|
||||
private LinkedHashMap<Integer, String> playlistPrivacies;
|
||||
private LinkedHashMap<String, String> translations;
|
||||
|
||||
public LinkedHashMap<String, String> getTranslations() {
|
||||
return translations;
|
||||
|
|
|
@ -34,8 +34,6 @@ public class PeertubeNotification {
|
|||
public PeertubeNotification() {
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ package app.fedilab.android.client.Entities;
|
|||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -28,6 +27,17 @@ import java.util.List;
|
|||
|
||||
public class PixelFedStory implements Parcelable {
|
||||
|
||||
public static final Parcelable.Creator<PixelFedStory> CREATOR = new Parcelable.Creator<PixelFedStory>() {
|
||||
@Override
|
||||
public PixelFedStory createFromParcel(Parcel source) {
|
||||
return new PixelFedStory(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PixelFedStory[] newArray(int size) {
|
||||
return new PixelFedStory[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String photo;
|
||||
private String name;
|
||||
|
@ -36,6 +46,20 @@ public class PixelFedStory implements Parcelable {
|
|||
private boolean seen;
|
||||
private List<PixelFedStoryItem> pixelFedStoryItems;
|
||||
|
||||
public PixelFedStory() {
|
||||
}
|
||||
|
||||
protected PixelFedStory(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.photo = in.readString();
|
||||
this.name = in.readString();
|
||||
this.link = in.readString();
|
||||
long tmpLastUpdated = in.readLong();
|
||||
this.lastUpdated = tmpLastUpdated == -1 ? null : new Date(tmpLastUpdated);
|
||||
this.seen = in.readByte() != 0;
|
||||
this.pixelFedStoryItems = in.createTypedArrayList(PixelFedStoryItem.CREATOR);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -92,7 +116,6 @@ public class PixelFedStory implements Parcelable {
|
|||
this.pixelFedStoryItems = pixelFedStoryItems;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
|
@ -108,30 +131,4 @@ public class PixelFedStory implements Parcelable {
|
|||
dest.writeByte(this.seen ? (byte) 1 : (byte) 0);
|
||||
dest.writeTypedList(this.pixelFedStoryItems);
|
||||
}
|
||||
|
||||
public PixelFedStory() {
|
||||
}
|
||||
|
||||
protected PixelFedStory(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.photo = in.readString();
|
||||
this.name = in.readString();
|
||||
this.link = in.readString();
|
||||
long tmpLastUpdated = in.readLong();
|
||||
this.lastUpdated = tmpLastUpdated == -1 ? null : new Date(tmpLastUpdated);
|
||||
this.seen = in.readByte() != 0;
|
||||
this.pixelFedStoryItems = in.createTypedArrayList(PixelFedStoryItem.CREATOR);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<PixelFedStory> CREATOR = new Parcelable.Creator<PixelFedStory>() {
|
||||
@Override
|
||||
public PixelFedStory createFromParcel(Parcel source) {
|
||||
return new PixelFedStory(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PixelFedStory[] newArray(int size) {
|
||||
return new PixelFedStory[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,6 +25,17 @@ import java.util.Date;
|
|||
|
||||
public class PixelFedStoryItem implements Parcelable {
|
||||
|
||||
public static final Parcelable.Creator<PixelFedStoryItem> CREATOR = new Parcelable.Creator<PixelFedStoryItem>() {
|
||||
@Override
|
||||
public PixelFedStoryItem createFromParcel(Parcel source) {
|
||||
return new PixelFedStoryItem(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PixelFedStoryItem[] newArray(int size) {
|
||||
return new PixelFedStoryItem[size];
|
||||
}
|
||||
};
|
||||
private String id;
|
||||
private String type;
|
||||
private int length;
|
||||
|
@ -36,8 +47,23 @@ public class PixelFedStoryItem implements Parcelable {
|
|||
private Date expires_at;
|
||||
private boolean seen;
|
||||
|
||||
public PixelFedStoryItem() {
|
||||
}
|
||||
|
||||
|
||||
protected PixelFedStoryItem(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.type = in.readString();
|
||||
this.length = in.readInt();
|
||||
this.src = in.readString();
|
||||
this.preview = in.readString();
|
||||
this.link = in.readString();
|
||||
this.linkText = in.readString();
|
||||
long tmpTime = in.readLong();
|
||||
this.time = tmpTime == -1 ? null : new Date(tmpTime);
|
||||
long tmpExpires_at = in.readLong();
|
||||
this.expires_at = tmpExpires_at == -1 ? null : new Date(tmpExpires_at);
|
||||
this.seen = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -137,34 +163,4 @@ public class PixelFedStoryItem implements Parcelable {
|
|||
dest.writeLong(this.expires_at != null ? this.expires_at.getTime() : -1);
|
||||
dest.writeByte(this.seen ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
public PixelFedStoryItem() {
|
||||
}
|
||||
|
||||
protected PixelFedStoryItem(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.type = in.readString();
|
||||
this.length = in.readInt();
|
||||
this.src = in.readString();
|
||||
this.preview = in.readString();
|
||||
this.link = in.readString();
|
||||
this.linkText = in.readString();
|
||||
long tmpTime = in.readLong();
|
||||
this.time = tmpTime == -1 ? null : new Date(tmpTime);
|
||||
long tmpExpires_at = in.readLong();
|
||||
this.expires_at = tmpExpires_at == -1 ? null : new Date(tmpExpires_at);
|
||||
this.seen = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<PixelFedStoryItem> CREATOR = new Parcelable.Creator<PixelFedStoryItem>() {
|
||||
@Override
|
||||
public PixelFedStoryItem createFromParcel(Parcel source) {
|
||||
return new PixelFedStoryItem(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PixelFedStoryItem[] newArray(int size) {
|
||||
return new PixelFedStoryItem[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue