Merge branch 'develop' of https://framagit.org/tom79/fedilab-tube into develop

 Conflicts:
	app/build.gradle
	app/src/main/java/app/fedilab/fedilabtube/helper/HelperAcadInstance.java
This commit is contained in:
Thomas 2022-05-05 08:28:01 +02:00
commit 2456e8f782
78 changed files with 295 additions and 1919 deletions

View File

@ -4,13 +4,12 @@ apply plugin: "androidx.navigation.safeargs"
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion 31
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 43
versionName "1.14.1"
multiDexEnabled true
@ -102,21 +101,7 @@ android {
buildConfigField "int", "cast_enabled", "1"
buildConfigField "int", "default_theme", "2"
}
bittube {
applicationId "app.fedilab.bittube"
resValue "string", "app_name", "Bittube"
resValue "string", "app_id", "app.fedilab.bittube"
buildConfigField "String", "version", "\"bittube\""
buildConfigField "boolean", "full_instances", "true"
buildConfigField "boolean", "google_restriction", "true"
buildConfigField "boolean", "surfing_mode", "false"
buildConfigField "boolean", "sepia_search", "false"
buildConfigField "boolean", "instance_switcher", "true"
buildConfigField "boolean", "allow_remote_connections", "false"
buildConfigField "boolean", "google_cast_lib", "true"
buildConfigField "int", "cast_enabled", "1"
buildConfigField "int", "default_theme", "1"
}
}
sourceSets {
@ -137,10 +122,6 @@ android {
res.srcDirs = ['src/main/res', 'src/google_donation/res', 'src/google_cast_lib/res', 'src/full/res']
java.srcDirs = ['src/main/java', 'src/full/java', 'src/google_donation/java', 'src/google_cast_lib/java']
}
bittube {
res.srcDirs = ['src/main/res', 'src/google_cast_lib/res', 'src/bittube/res']
java.srcDirs = ['src/main/java', 'src/full/java', 'src/no_google_donation/java', 'src/google_cast_lib/java']
}
}
}
@ -155,25 +136,25 @@ allprojects {
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.navigation:navigation-fragment:2.3.3'
implementation "androidx.fragment:fragment:1.3.0"
implementation 'androidx.navigation:navigation-ui:2.3.3'
implementation ("androidx.navigation:navigation-dynamic-features-fragment:2.3.3")
implementation 'androidx.navigation:navigation-fragment:2.4.2'
implementation "androidx.fragment:fragment:1.4.1"
implementation 'androidx.navigation:navigation-ui:2.4.2'
implementation ("androidx.navigation:navigation-dynamic-features-fragment:2.4.2")
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation project(path: ':torrentStream')
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.github.GrenderG:Toasty:1.4.2'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.github.GrenderG:Toasty:1.5.2'
implementation 'com.google.android.exoplayer:exoplayer:2.12.2'
implementation 'com.google.android.exoplayer:extension-mediasession:2.12.2'
implementation "com.github.mabbas007:TagsEditText:1.0.5"
@ -184,7 +165,7 @@ dependencies {
implementation "net.gotev:uploadservice:4.5.1"
implementation "net.gotev:uploadservice-okhttp:4.5.1"
implementation "com.google.code.gson:gson:2.8.6"
implementation 'androidx.media:media:1.2.1'
implementation 'androidx.media:media:1.6.0'
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
@ -194,12 +175,11 @@ dependencies {
implementation "io.github.kobakei:ratethisapp:1.2.0"
implementation 'com.github.vkay94:DoubleTapPlayerView:1.0.0'
implementation "androidx.work:work-runtime:2.5.0"
implementation "androidx.work:work-runtime-ktx:2.5.0"
implementation "androidx.work:work-runtime:2.7.1"
//************ DONATION GOOGLE ONLY **************//
google_fullImplementation "com.android.billingclient:billing:3.0.2"
google_fullImplementation "com.android.billingclient:billing:4.1.0"
//************ MATOMO --> acad instances only **************//
@ -208,13 +188,16 @@ dependencies {
//************ CAST **************///
//---> Google libs (google_full + bittube)
google_acadImplementation "androidx.mediarouter:mediarouter:1.2.2"
google_acadImplementation 'com.google.android.gms:play-services-cast-framework:19.0.0'
google_fullImplementation "androidx.mediarouter:mediarouter:1.2.2"
google_fullImplementation 'com.google.android.gms:play-services-cast-framework:19.0.0'
bittubeImplementation "androidx.mediarouter:mediarouter:1.2.2"
bittubeImplementation 'com.google.android.gms:play-services-cast-framework:19.0.0'
//---> Google libs (google_full)
google_acadImplementation "com.google.android.gms:play-services-cast-tv:19.0.1"
google_acadImplementation "com.google.android.gms:play-services-cast:21.0.1"
google_acadImplementation "androidx.mediarouter:mediarouter:1.3.0"
google_acadImplementation 'com.google.android.gms:play-services-cast-framework:21.0.1'
google_fullImplementation "com.google.android.gms:play-services-cast-tv:19.0.1"
google_fullImplementation "com.google.android.gms:play-services-cast:21.0.1"
google_fullImplementation "androidx.mediarouter:mediarouter:1.3.0"
google_fullImplementation 'com.google.android.gms:play-services-cast-framework:21.0.1'
//----> Other flavors
fdroid_acadImplementation 'su.litvak.chromecast:api-v2:0.11.3'
@ -224,5 +207,4 @@ dependencies {
fdroid_fullImplementation 'com.fasterxml.jackson.core:jackson-core:2.12.0'
fdroid_fullImplementation 'org.slf4j:slf4j-simple:1.7.30'
}

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="app.fedilab.fedilabtube">
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:name=".FedilabTube"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
<activity
android:name=".PeertubeActivity"
tools:node="mergeOnlyAttributes">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- The app is a good candidate for URL in https://domain.name/videos/watch/xxxxx-->
<data
android:host="*"
android:pathPrefix="/videos/watch/"
android:scheme="https" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".PeertubeActivity" />
</activity>
<activity
android:name=".expandedcontrols.ExpandedControlsActivity"
android:theme="@style/AppThemeNoActionBar"
/>
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="app.fedilab.fedilabtube.provider.CastOptionsProvider" />
</application>
</manifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorAccent" android:state_checked="true" />
<item android:color="@android:color/tab_indicator_text" />
</selector>

View File

@ -1,15 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<group android:scaleX="0.92"
android:scaleY="0.92"
android:translateX="0.96"
android:translateY="0.96">
<path
android:fillColor="@android:color/white"
android:pathData="M8,5v14l11,-7z"/>
</group>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 B

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

View File

@ -1,856 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path android:pathData="M85.355,14.645C75.91,5.201 63.354,0 50,0C36.644,0 24.088,5.201 14.645,14.645S0,36.644 0,50c0,13.357 5.201,25.913 14.645,35.355C24.087,94.799 36.643,100 50,100c13.357,0 25.913,-5.201 35.355,-14.645C94.799,75.912 100,63.356 100,50C100,36.646 94.799,24.09 85.355,14.645z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="15.7699"
android:endY="86.8818"
android:startX="83.2562"
android:startY="14.1677"
android:type="linear">
<item
android:color="#FF28D1BC"
android:offset="0" />
<item
android:color="#FF00ABFF"
android:offset="0.6" />
<item
android:color="#FF2A5ED6"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M3.151,32.464L13.3,46.493L30.239,4.045c-5.75,2.474 -11.035,6.041 -15.595,10.6C9.504,19.786 5.623,25.851 3.151,32.464z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="24.2938"
android:endY="39.2239"
android:startX="-4.1098"
android:startY="-39.1612"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.5762" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M2.3,34.893c-1.5,4.8 -2.3,9.8 -2.3,15c0,2.8 0.2,5.5 0.7,8.2l7.8,10l36.878,-26.896L2.3,34.893z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="26.5038"
android:endY="54.332794"
android:startX="-2.655"
android:startY="33.41799"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.006" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M40.8,5.893l27.6,28.3l8.9,-26.2c-5.8,-3.8 -12.3,-6.3 -19.2,-7.4L40.8,5.893z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="62.8149"
android:endY="14.768093"
android:startX="84.794"
android:startY="0.65519285"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0013" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M42.79,46.347l25.8,0.6l-27.6,-28.3z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="45.013"
android:endY="42.08"
android:startX="59.9387"
android:startY="27.9081"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M96.88,67.451C98.928,61.941 100,56.054 100,50c0,-0.202 -0.005,-0.402 -0.007,-0.604L68.806,34.399L96.88,67.451z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="79.7008"
android:endY="33.716"
android:startX="107.2237"
android:startY="81.6425"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0029" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M27.8,15.893l17.4,11.8l3.7,-21.1z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.8608"
android:endY="17.1429"
android:startX="27.8"
android:startY="17.1429"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="8.440641E-4" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M97.976,35.848l-5.312,-1.255l3.7,24l3.329,-3.044C99.895,53.719 100,51.868 100,50C100,45.14 99.308,40.386 97.976,35.848z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="93.5393"
android:endY="46.7512"
android:startX="101.8224"
android:startY="45.4073"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0017" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M72.998,85.447l2.742,7.442c2.87,-1.729 5.579,-3.761 8.092,-6.075L72.998,85.447z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="77.1128"
android:endY="79.7658"
android:startX="81.8324"
android:startY="102.8394"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0013" />
<item
android:color="#00FFFFFF"
android:offset="0.9982" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M87.435,83.143c2.349,-2.646 4.393,-5.5 6.108,-8.522l-28.357,2.776L87.435,83.143z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="65.4945"
android:endY="79.3595"
android:startX="123.109"
android:startY="78.2586"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0022" />
<item
android:color="#00FFFFFF"
android:offset="0.9966" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M72.9,85.193l-56.3,-11.1l7.2,18.4c1.6,1 3.3,1.9 5.1,2.7L72.9,85.193z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="38.2047"
android:endY="89.4249"
android:startX="58.4365"
android:startY="59.1884"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0015" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.71"
android:pathData="M79.09,58.897l-21,1.5l10.3,18.9z"
android:strokeAlpha="0.71">
<aapt:attr name="android:fillColor">
<gradient
android:endX="61.745285"
android:endY="71.03565"
android:startX="78.23818"
android:startY="57.920563"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0" />
<item
android:color="#00FFFFFF"
android:offset="0.9993" />
</gradient>
</aapt:attr>
</path>
<group>
<clip-path android:pathData="M50,50m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0" />
<path android:pathData="M31.304,22.589v0.7c0,0.1 0,0.1 -0.1,0.2l-1.9,0.8c0,0 0,0 -0.1,0s0,0 -0.1,0l-0.4,-0.2l19.7,27l2.4,-1.7L31.304,22.589z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.7969"
android:endY="36.839092"
android:startX="28.7808"
android:startY="36.839092"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.006" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M65.409,20.005l-0.005,-1.116l-17,30.7l2.5,1.4l16.722,-30.026L65.409,20.005z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.3499"
android:endY="34.939095"
android:startX="67.5984"
android:startY="34.939095"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0013" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M79.625,18.344l-0.021,-1.254l-31.3,32.1l2.1,2l31.2,-32L79.625,18.344z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.3039"
android:endY="34.138992"
android:startX="81.6039"
android:startY="34.138992"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="7.851759E-5" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M90.104,35.389c-0.1,0 -0.1,-0.1 -0.1,-0.2v-2l-41.1,15.7l1,2.7l41.3,-15.8L90.104,35.389z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.8205"
android:endY="42.388992"
android:startX="91.2039"
android:startY="42.388992"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0038" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M11.804,27.989v1.8c0,0.1 -0.1,0.2 -0.1,0.2l-1.2,0.5l38.5,20.9l1.4,-2.6L11.804,27.989z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.3298"
android:endY="39.689095"
android:startX="10.4298"
android:startY="39.689095"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0025" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M17.265,50.089c0.1,0 0.1,0.2 0.1,0.2v2.5c0,0.1 -0.1,0.2 -0.1,0.2l32.439,-1.3l-0.1,-2.9L17.265,50.089z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="49.6603"
android:endY="50.888992"
android:startX="17.2212"
android:startY="50.888992"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="3.140703E-4" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M7.668,60.675c0.036,0.014 0.234,0.056 0.236,0.214l0,0l0,0v1.9l42.1,-11.2l-0.9,-2.8l-42.8,11.4C6.304,60.189 7.632,60.661 7.668,60.675z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.0039"
android:endY="55.789093"
android:startX="6.304"
android:startY="55.789093"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0047" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M33.904,62.147v1.942l16.7,-11.95l-1.8,-2.3L32.611,61.406L33.904,62.147z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.5851"
android:endY="56.964092"
android:startX="32.571"
android:startY="56.964092"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.003" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M35.804,35.789v1.2c0,0.1 -0.1,0.2 -0.1,0.2l-1.8,0.8l14.5,13.4l2,-2.1L35.804,35.789z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.3668"
android:endY="43.589092"
android:startX="33.8669"
android:startY="43.589092"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0048" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M55.804,33.089C55.804,33.089 55.704,33.089 55.804,33.089c-0.1,0 -0.1,0 -0.2,0l-1.9,-0.8l0,0l-5.4,17.5l2.8,0.9l5.5,-17.9L55.804,33.089z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.2319"
android:endY="41.489094"
android:startX="56.5588"
android:startY="41.489094"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M64.804,45.489l-13.8,3.2l0.7,2.8l13.8,-3.2L64.804,45.489z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="50.9512"
android:endY="48.489094"
android:startX="65.4322"
android:startY="48.489094"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0032" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M74.107,63.536L74.107,63.536L74.107,63.536c0,-0.098 0,-0.098 0.098,-0.195l0,0l0,0l0,0l1.172,-0.391L50.571,49.278l-1.367,2.441l24.903,13.77C74.107,65.489 74.107,63.536 74.107,63.536z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="49.2177"
android:endY="57.3833"
android:startX="75.4526"
android:startY="57.3833"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="5.496231E-4" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M81.904,79.089L81.904,79.089L81.904,79.089L81.904,79.089l2,-0.6c0,0 0,0 0.1,0l-33.7,-29.4l-1.9,2.2l33.3,29v-1C81.704,79.289 81.694,79.141 81.904,79.089z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.4039"
android:endY="64.689095"
android:startX="84.0039"
android:startY="64.689095"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0012" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M54.404,79.689l2,-0.6h0.1l0.7,0.2l-6.2,-29.7l-2.8,0.6L54.404,79.689L54.404,79.689z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="48.1377"
android:endY="64.63899"
android:startX="57.3221"
android:startY="64.63899"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.0025" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M64.804,46.689l-15.6,2.1l0.4,2.9l30.2,-4.1l-0.4,-0.1c-0.1,0 -0.1,-0.1 -0.1,-0.2v-2.5l0,0l0,0l0,0L64.804,46.689">
<aapt:attr name="android:fillColor">
<gradient
android:endX="49.1732"
android:endY="48.239094"
android:startX="79.7731"
android:startY="48.239094"
android:type="linear">
<item
android:color="#FFFFFFFF"
android:offset="0.003" />
<item
android:color="#00FFFFFF"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
</group>
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M51.639,0.029l-10.172,9.922l38.598,0.091"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M65.366,2.397L67.311,16.642"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M77.224,8.046L71.304,14.042"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M79.609,16.642L69.609,17.642"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M83.78,13.139L82.883,14.965"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M85.325,14.615c0.096,0.097 -3.374,29.468 -3.374,29.468"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M89.811,35.231L68.98,45.442"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M81.157,19.065L67.957,44.865"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M89.66,32.342l-48.193,-22.391l23.922,7.289"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M69.592,19.841L93.523,25.345"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M91.096,21.502L91.699,31.585"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M95.08,28.318L93.554,32.271"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M92.657,35.991L91.055,78.558"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M78.616,65.137L96.149,69.308"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M99.904,46.935L78.571,63.748"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M99.296,41.575c-0.585,0.17 -15.743,4.529 -15.743,4.529l16.414,5.629"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M99.766,54.87l-15.164,16.679l5.749,7.991"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M77.456,66.713L83.427,78.637"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M84.31,82.536L83.75,86.889"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M85.28,82.142L86.327,84.354"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M81.12,48.139l-4.73,14.382l-8.132,-14.106"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M79.18,45.887L68.951,46.291"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M79.305,47.596L17.837,88.283"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M54.335,79.846L33.835,64.846"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M65.137,48.23L16.967,87.533"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M75.145,66.556c-0.008,0.074 -16.683,13.266 -16.683,13.266"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M74.354,66.171L62.454,98.371"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M67.749,96.77L22.551,91.808"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M54.293,81.937L19.29,89.467"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M54.846,82.756l-18.767,15.187l48.523,-26.394"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M25.193,93.341L55.115,99.637"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M31.046,65.521L15.515,86.205"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M54.466,32.642L33.573,61.932"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M34.116,62.841L64.78,47.542"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M64.799,46.436L17.528,51.124"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M17.481,52.92L29.665,61.822"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M7.972,61.193L64.229,47.287"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M29.602,63.342L8.042,62.247"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M32.453,37.508L14.288,84.989"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M28.519,23.938L11.678,82.116"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M6.456,64.297L5.153,72.159"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M3.605,62.036L1.439,61.984"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M0.08,52.807L13.108,51.842"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M9.157,30.693L6.857,59.693"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M14.243,53.353L6.765,60.325"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M27.926,23.641L16.156,49.667"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M16.351,27.987L15.502,49.442"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M31.704,37.136L17.432,50.364"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M1.452,37.962L13.741,49.851"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M8.149,30.316L0.472,43.105"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M0.306,44.454L13.082,50.537"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M14.188,15.113L10.004,26.542"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M11.786,27.339L14.886,26.239"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M16.953,12.477L16.651,24.087"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M19.154,24.807L27.254,21.972"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M20.361,9.72L28.536,20.331"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M54.069,29.329L27.064,5.547"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M31.287,22.039L53.587,29.739"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M53.593,30.937L35.793,34.637"
android:strokeAlpha="0.6" />
<path
android:fillAlpha="0.6"
android:fillColor="#FF000000"
android:pathData="M64.821,45.539L35.934,36.076"
android:strokeAlpha="0.6" />
<path
android:fillColor="#FFFFFF"
android:pathData="M81.802,15.419l-1.317,0.456l1.327,0.511l1.327,-0.511L81.802,15.419zM80.162,18.059l1.476,0.588v-1.92l-1.476,-0.588V18.059zM82.004,16.705v1.942l1.441,-0.584v-1.924L82.004,16.705z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M67.443,17.033l-1.317,0.456L67.453,18l1.327,-0.511L67.443,17.033zM65.804,19.673l1.476,0.588v-1.92l-1.476,-0.588V19.673zM67.646,18.319v1.942l1.441,-0.584v-1.924L67.646,18.319z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M55.737,29.211l-1.317,0.456l1.327,0.511l1.327,-0.511L55.737,29.211zM54.098,31.851l1.476,0.588v-1.92l-1.476,-0.588V31.851zM55.94,30.497v1.942l1.441,-0.584v-1.924L55.94,30.497z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M29.251,20.523l-1.317,0.456l1.327,0.511l1.327,-0.511L29.251,20.523zM27.611,23.164l1.476,0.588v-1.92l-1.476,-0.588V23.164zM29.453,21.81v1.942l1.441,-0.584v-1.924L29.453,21.81z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M15.227,49.775l-1.317,0.456l1.327,0.511l1.327,-0.511L15.227,49.775zM13.587,52.415l1.476,0.588v-1.92l-1.476,-0.588V52.415zM15.429,51.062v1.942l1.441,-0.584v-1.924L15.429,51.062z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M9.601,26.95l-1.317,0.456l1.327,0.511l1.327,-0.511L9.601,26.95zM7.962,29.59l1.476,0.588v-1.92L7.962,27.67V29.59zM9.804,28.236v1.942l1.441,-0.584V27.67L9.804,28.236z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M56.429,79.561l-1.317,0.456l1.327,0.511l1.327,-0.511L56.429,79.561zM54.79,82.201l1.476,0.588v-1.92l-1.476,-0.588V82.201zM56.632,80.847v1.942l1.441,-0.584v-1.924L56.632,80.847z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M33.602,34.175l-1.317,0.456l1.327,0.511l1.327,-0.511L33.602,34.175zM31.963,36.815l1.476,0.588v-1.92l-1.476,-0.588V36.815zM33.804,35.462v1.942l1.441,-0.584v-1.924L33.804,35.462z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M31.796,61.722l-1.317,0.456l1.327,0.511l1.327,-0.511L31.796,61.722zM30.156,64.362l1.476,0.588v-1.92l-1.476,-0.588V64.362zM31.998,63.009v1.942l1.441,-0.584v-1.924L31.998,63.009z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M83.96,79.141l-1.317,0.456l1.327,0.511l1.327,-0.511L83.96,79.141zM82.321,81.781l1.476,0.588v-1.92l-1.476,-0.588V81.781zM84.162,80.428v1.942l1.441,-0.584v-1.924L84.162,80.428z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M76.393,63.075l-1.317,0.456l1.327,0.511l1.327,-0.511L76.393,63.075zM74.754,65.715l1.476,0.588v-1.92l-1.476,-0.588V65.715zM76.596,64.362v1.942l1.441,-0.584v-1.924L76.596,64.362z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M81.202,44.475l-1.317,0.456l1.327,0.511l1.327,-0.511L81.202,44.475zM79.563,47.115l1.476,0.588v-1.92l-1.476,-0.588V47.115zM81.404,45.762v1.942l1.441,-0.584v-1.924L81.404,45.762z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M92.296,32.228l-1.317,0.456l1.327,0.511l1.327,-0.511L92.296,32.228zM90.656,34.868l1.476,0.588v-1.92l-1.476,-0.588V34.868zM92.498,33.515v1.942l1.441,-0.584v-1.924L92.498,33.515z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M5.806,60.518l-1.317,0.456l1.327,0.511l1.327,-0.511L5.806,60.518zM4.167,63.158l1.476,0.588v-1.92l-1.476,-0.588V63.158zM6.009,61.804v1.942l1.441,-0.584v-1.924L6.009,61.804z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M24.691,30.255c-0.615,0.788 -0.538,1.99 0.329,2.667c0.867,0.677 1.99,0.538 2.667,-0.329c6.397,-8.2 16.796,-12.263 27.125,-10.546c0.658,0.133 1.342,-0.095 1.773,-0.646c0.185,-0.237 0.29,-0.535 0.396,-0.833c0.088,-0.438 0.019,-1 -0.314,-1.386s-0.727,-0.694 -1.165,-0.782C43.638,16.373 31.949,20.952 24.691,30.255z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M71.1,47.4L41.3,29.2c-1,-0.5 -2.2,-0.5 -3.2,0.1s-1.6,1.6 -1.6,2.8v36.2c0,1.1 0.6,2.2 1.6,2.8c0.5,0.3 1.1,0.5 1.6,0.5s1.1,-0.1 1.6,-0.4L71.1,53c1,-0.6 1.6,-1.6 1.6,-2.8C72.7,49.1 72.1,48 71.1,47.4zM68.5,50.2L40.3,67.4V33L68.5,50.2z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M79.6,20.4C71.7,12.6 61.2,8.2 50,8.2s-21.7,4.3 -29.6,12.2C12.6,28.3 8.2,38.8 8.2,50s4.3,21.7 12.2,29.6S38.8,91.8 50,91.8s21.7,-4.3 29.6,-12.2S91.8,61.2 91.8,50S87.4,28.3 79.6,20.4zM88.1,50c0,10.2 -4,19.7 -11.2,26.9C69.7,84.1 60.2,88.1 50,88.1s-19.7,-4 -26.9,-11.2C15.9,69.7 11.9,60.2 11.9,50s4,-19.7 11.2,-26.9S39.9,11.9 50,11.9c10.2,0 19.7,4 26.9,11.2C84.1,30.3 88.1,39.8 88.1,50z" />
</vector>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#343434</color>
<color name="colorPrimaryDark">#343434</color>
<color name="colorAccent">#00abff</color>
<color name="tag_color">#bbF2690D</color>
<color name="tag_color_text">#FAFAFA</color>
<color name="positive_thumbs">#2b90d9</color>
<color name="favorite">#ca8f04</color>
<color name="bookmark">#795548</color>
<color name="negative_thumbs">#F44336</color>
<color name="backgroundDark">#DD000000</color>
<color name="red_1">#F44336</color>
<color name="gray_light">#80808080</color>
</resources>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="my_images"
path="/Bittube/" />
</paths>

View File

@ -16,7 +16,8 @@
<activity
android:name=".MainActivity"
tools:node="merge">
tools:node="merge"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />

View File

@ -1,4 +1,18 @@
package app.fedilab.fedilabtube;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of TubeLab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.content.SharedPreferences;
@ -7,6 +21,7 @@ import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.exoplayer2.SimpleExoPlayer;
@ -23,21 +38,6 @@ import app.fedilab.fedilabtube.client.data.VideoData;
import app.fedilab.fedilabtube.databinding.ActivityPeertubeBinding;
import app.fedilab.fedilabtube.helper.Helper;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of TubeLab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
public class BasePeertubeActivity extends AppCompatActivity {
protected ActivityPeertubeBinding binding;
@ -58,11 +58,10 @@ public class BasePeertubeActivity extends AppCompatActivity {
View view = binding.getRoot();
setContentView(view);
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int search_cast = sharedpreferences.getInt(getString(R.string.set_cast_choice), BuildConfig.cast_enabled);
if (search_cast == 1) {
setupCastListener();
mCastContext = CastContext.getSharedInstance(this);
mCastContext = CastContext.getSharedInstance(BasePeertubeActivity.this);
mCastSession = mCastContext.getSessionManager().getCurrentCastSession();
}
@ -82,7 +81,7 @@ public class BasePeertubeActivity extends AppCompatActivity {
MediaInfo mediaInfo = new MediaInfo.Builder(videoURL)
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setMetadata(movieMetadata)
.setStreamDuration(peertube.getDuration() * 1000)
.setStreamDuration(peertube.getDuration() * 1000L)
.build();
if (mCastSession != null) {
RemoteMediaClient remoteMediaClient = mCastSession.getRemoteMediaClient();
@ -94,45 +93,45 @@ public class BasePeertubeActivity extends AppCompatActivity {
private void setupCastListener() {
mSessionManagerListener = new SessionManagerListener<CastSession>() {
@Override
public void onSessionStarting(CastSession castSession) {
public void onSessionStarting(@NonNull CastSession castSession) {
}
@Override
public void onSessionStarted(CastSession castSession, String s) {
public void onSessionStarted(@NonNull CastSession castSession, String s) {
onApplicationConnected(castSession, true);
}
@Override
public void onSessionStartFailed(CastSession castSession, int i) {
public void onSessionStartFailed(@NonNull CastSession castSession, int i) {
onApplicationDisconnected();
}
@Override
public void onSessionEnding(CastSession castSession) {
public void onSessionEnding(@NonNull CastSession castSession) {
onApplicationDisconnected();
}
@Override
public void onSessionEnded(CastSession castSession, int i) {
public void onSessionEnded(@NonNull CastSession castSession, int i) {
onApplicationDisconnected();
}
@Override
public void onSessionResuming(CastSession castSession, String s) {
public void onSessionResuming(@NonNull CastSession castSession, String s) {
}
@Override
public void onSessionResumed(CastSession castSession, boolean b) {
public void onSessionResumed(@NonNull CastSession castSession, boolean b) {
onApplicationConnected(castSession, false);
}
@Override
public void onSessionResumeFailed(CastSession castSession, int i) {
public void onSessionResumeFailed(@NonNull CastSession castSession, int i) {
onApplicationDisconnected();
}
@Override
public void onSessionSuspended(CastSession castSession, int i) {
public void onSessionSuspended(@NonNull CastSession castSession, int i) {
onApplicationDisconnected();
}

View File

@ -1,54 +1,26 @@
package app.fedilab.fedilabtube.provider;
/* Copyright 2021 Thomas Schneider
*
* This file is a part of TubeLab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* TubeLab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import androidx.annotation.NonNull;
import com.google.android.gms.cast.framework.CastOptions;
import com.google.android.gms.cast.framework.OptionsProvider;
import com.google.android.gms.cast.framework.SessionProvider;
import com.google.android.gms.cast.framework.media.CastMediaOptions;
import com.google.android.gms.cast.framework.media.NotificationOptions;
import java.util.List;
import app.fedilab.fedilabtube.BuildConfig;
import app.fedilab.fedilabtube.expandedcontrols.ExpandedControlsActivity;
import app.fedilab.fedilabtube.helper.Helper;
public class CastOptionsProvider implements OptionsProvider {
@Override
public CastOptions getCastOptions(Context context) {
NotificationOptions notificationOptions = new NotificationOptions.Builder()
.setTargetActivityClassName(ExpandedControlsActivity.class.getName())
.build();
CastMediaOptions mediaOptions = new CastMediaOptions.Builder()
.setNotificationOptions(notificationOptions)
.setExpandedControllerActivityClassName(ExpandedControlsActivity.class.getName())
.build();
public CastOptions getCastOptions(@NonNull Context context) {
return new CastOptions.Builder()
.setReceiverApplicationId(BuildConfig.FLAVOR.compareTo("bittube") == 0 ? Helper.CAST_ID_BITTUBE : Helper.CAST_ID)
.setCastMediaOptions(mediaOptions)
.setReceiverApplicationId(Helper.CAST_ID)
.build();
}
@Override
public List<SessionProvider> getAdditionalSessionProviders(Context context) {
public List<SessionProvider> getAdditionalSessionProviders(@NonNull Context context) {
return null;
}
}

View File

@ -31,7 +31,7 @@
android:name=".MainActivity"
android:theme="@style/AppThemeNoActionBar"
android:configChanges="orientation|screenSize"
android:label="@string/app_name">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -43,7 +43,6 @@
<activity
android:name=".PeertubeActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:label="@string/app_name"
android:launchMode="singleTask"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
@ -51,65 +50,53 @@
<activity
android:name=".PeertubeEditUploadActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:exported="false"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".ShowChannelActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".ShowAccountActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".AccountActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".MyAccountActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".SearchActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".AllPlaylistsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".AllLocalPlaylistsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".InstancePickerActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".PlaylistsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".LocalPlaylistsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".VideosTimelineActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".SepiaSearchActivity"
@ -123,21 +110,19 @@
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".WebviewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".WebviewConnectActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MastodonWebviewConnectActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
/>
<activity
android:name=".LoginActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden">
android:windowSoftInputMode="stateAlwaysHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -175,12 +160,6 @@
android:name=".services.RetrieveInfoService"
android:exported="false" />
<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
tools:node="remove"
android:exported="false" />
<provider
android:name="androidx.core.content.FileProvider"
@ -191,6 +170,9 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>

View File

@ -104,19 +104,10 @@ public class AboutActivity extends AppCompatActivity {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/Mastalab"));
startActivity(browserIntent);
});
if (BuildConfig.FLAVOR.equals("queermotion")) {
donatePaypal.setVisibility(View.GONE);
LinearLayout dev_info = findViewById(R.id.dev_info);
dev_info.setVisibility(View.GONE);
}
Button donateLiberapay = findViewById(R.id.donate_liberapay);
donateLiberapay.setOnClickListener(v -> {
Intent browserIntent;
if (BuildConfig.FLAVOR.equals("queermotion")) {
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://soutenir.queermotion.org"));
} else {
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79"));
}
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79"));
startActivity(browserIntent);
});

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.badgeCount;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
@ -54,13 +56,12 @@ import app.fedilab.fedilabtube.helper.SwitchAccountHelper;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import static app.fedilab.fedilabtube.MainActivity.badgeCount;
public class AccountActivity extends AppCompatActivity {
private ActivityAccountBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -259,6 +260,11 @@ public class AccountActivity extends AppCompatActivity {
super.onDestroy();
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.slide_out_up, R.anim.slide_in_up_down);
}
/**
* Pager adapter for three tabs (notifications, muted, blocked)
@ -292,11 +298,5 @@ public class AccountActivity extends AppCompatActivity {
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.slide_out_up, R.anim.slide_in_up_down);
}
}

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
@ -67,9 +70,6 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistAdapter.AllPlaylistRemoved {

View File

@ -22,8 +22,6 @@ import android.os.Build;
import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
import androidx.work.Configuration;
import androidx.work.WorkManager;
import net.gotev.uploadservice.UploadServiceConfig;
import net.gotev.uploadservice.observer.request.GlobalRequestObserver;
@ -45,10 +43,6 @@ public class BaseFedilabTube extends MultiDexApplication {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int interval = sharedpreferences.getInt(Helper.NOTIFICATION_INTERVAL, 60);
Configuration myConfig = new Configuration.Builder()
.setMinimumLoggingLevel(android.util.Log.INFO)
.build();
WorkManager.initialize(BaseFedilabTube.this, myConfig);
if (interval >= 15) {
WorkHelper.fetchNotifications(this, interval);
}

View File

@ -15,6 +15,8 @@ package app.fedilab.fedilabtube;
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
@ -48,8 +50,6 @@ import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
import app.fedilab.fedilabtube.viewmodel.InstancesVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class InstancePickerActivity extends AppCompatActivity {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.updateCredential;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
@ -22,7 +24,6 @@ import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.text.style.UnderlineSpan;
import android.util.Log;
import android.util.Patterns;
import android.view.MenuItem;
import android.view.View;
@ -54,8 +55,6 @@ import app.fedilab.fedilabtube.helper.HelperAcadInstance;
import app.fedilab.fedilabtube.helper.HelperInstance;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.updateCredential;
public class LoginActivity extends AppCompatActivity {
@ -78,11 +77,7 @@ public class LoginActivity extends AppCompatActivity {
SpannableString content_create;
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
content_create = new SpannableString(getString(R.string.register_account));
} else {
content_create = new SpannableString(getString(R.string.join_peertube));
}
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, Helper.getColorAccent())), 0, content_create.length(),
@ -100,11 +95,6 @@ public class LoginActivity extends AppCompatActivity {
if (BuildConfig.full_instances && BuildConfig.instance_switcher) {
binding.loginInstanceContainer.setVisibility(View.VISIBLE);
}
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) {
binding.loginInstance.setText("bittube.video");
}
if (Helper.isTablet(LoginActivity.this)) {
@ -141,11 +131,8 @@ public class LoginActivity extends AppCompatActivity {
for (AcadInstances ac : acadInstances) {
academiesKey[i] = ac.getName();
academiesValue[i] = ac.getUrl();
Log.v(Helper.TAG, "url 1: " + ac.getUrl());
Log.v(Helper.TAG, "url 2: " + acad);
if (ac.getUrl().compareTo(acad) == 0) {
position = i;
Log.v(Helper.TAG, "ok: " + position);
}
i++;
}
@ -156,17 +143,10 @@ public class LoginActivity extends AppCompatActivity {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
acadInstance = academiesValue[position];
if (acadInstances.get(position).isOpenId()) {
binding.loginUidContainer.setVisibility(View.GONE);
binding.loginPasswdContainer.setVisibility(View.GONE);
binding.loginInstanceContainer.setVisibility(View.GONE);
binding.createAnAccountPeertube.setVisibility(View.GONE);
} else {
binding.loginUidContainer.setVisibility(View.VISIBLE);
binding.loginPasswdContainer.setVisibility(View.VISIBLE);
binding.loginInstanceContainer.setVisibility(View.GONE);
binding.createAnAccountPeertube.setVisibility(View.VISIBLE);
}
binding.loginUidContainer.setVisibility(View.GONE);
binding.loginPasswdContainer.setVisibility(View.GONE);
binding.loginInstanceContainer.setVisibility(View.GONE);
binding.createAnAccountPeertube.setVisibility(View.GONE);
}
@Override
@ -222,7 +202,7 @@ public class LoginActivity extends AppCompatActivity {
editor.apply();
Intent intent = new Intent(LoginActivity.this, WebviewConnectActivity.class);
Bundle b = new Bundle();
b.putString("url", "https://" + acadInstance + "/plugins/auth-openid-connect/0.0.1/auth/openid-connect");
b.putString("url", "https://" + acadInstance + "/plugins/auth-openid-connect/0.0.7/auth/openid-connect");
intent.putExtras(b);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

View File

@ -14,6 +14,10 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.NORMAL;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
@ -82,10 +86,6 @@ import app.fedilab.fedilabtube.sqlite.StoredInstanceDAO;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.NORMAL;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class MainActivity extends BaseMainActivity {
@ -95,12 +95,10 @@ public class MainActivity extends BaseMainActivity {
public static UserMe userMe;
public static InstanceData.InstanceConfig instanceConfig;
public static TypeOfConnection typeOfConnection;
public static int badgeCount;
private DisplayVideosFragment recentFragment, locaFragment, trendingFragment, subscriptionFragment, mostLikedFragment;
private DisplayOverviewFragment overviewFragment;
private ActivityMainBinding binding;
public static int badgeCount;
private final BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= item -> {
int itemId = item.getItemId();
@ -215,7 +213,6 @@ public class MainActivity extends BaseMainActivity {
}
@Override
public void onDestroy() {
super.onDestroy();
@ -223,7 +220,6 @@ public class MainActivity extends BaseMainActivity {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.PICK_INSTANCE_SURF;
import static app.fedilab.fedilabtube.MainActivity.showRadioButtonDialogFullInstances;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
@ -39,9 +42,6 @@ import app.fedilab.fedilabtube.sqlite.Sqlite;
import app.fedilab.fedilabtube.sqlite.StoredInstanceDAO;
import app.fedilab.fedilabtube.viewmodel.InfoInstanceVM;
import static app.fedilab.fedilabtube.MainActivity.PICK_INSTANCE_SURF;
import static app.fedilab.fedilabtube.MainActivity.showRadioButtonDialogFullInstances;
public class ManageInstancesActivity extends AppCompatActivity implements AboutInstanceAdapter.AllInstancesRemoved {

View File

@ -35,10 +35,10 @@ import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import app.fedilab.fedilabtube.client.mastodon.RetrofitMastodonAPI;
import app.fedilab.fedilabtube.client.entities.Error;
import app.fedilab.fedilabtube.client.entities.OauthParams;
import app.fedilab.fedilabtube.client.entities.Token;
import app.fedilab.fedilabtube.client.mastodon.RetrofitMastodonAPI;
import app.fedilab.fedilabtube.helper.Helper;
import es.dmoral.toasty.Toasty;

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import static app.fedilab.fedilabtube.worker.WorkHelper.NOTIFICATION_WORKER;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
@ -55,9 +58,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.worker.WorkHelper;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import static app.fedilab.fedilabtube.worker.WorkHelper.NOTIFICATION_WORKER;
public class MyAccountActivity extends AppCompatActivity {
private static final int PICK_IMAGE = 466;

View File

@ -14,6 +14,18 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static com.google.android.exoplayer2.Player.MEDIA_ITEM_TRANSITION_REASON_AUTO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.ADD_COMMENT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.RATEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_VIDEO;
import static app.fedilab.fedilabtube.helper.Helper.canMakeAction;
import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
import static app.fedilab.fedilabtube.helper.Helper.loadGiF;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
@ -158,23 +170,13 @@ import app.fedilab.fedilabtube.webview.MastalabWebChromeClient;
import app.fedilab.fedilabtube.webview.MastalabWebViewClient;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.ADD_COMMENT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.RATEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_VIDEO;
import static app.fedilab.fedilabtube.helper.Helper.canMakeAction;
import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
import static app.fedilab.fedilabtube.helper.Helper.loadGiF;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import static com.google.android.exoplayer2.Player.MEDIA_ITEM_TRANSITION_REASON_AUTO;
public class PeertubeActivity extends BasePeertubeActivity implements CommentListAdapter.AllCommentRemoved, Player.EventListener, VideoListener, TorrentListener, MenuAdapter.ItemClicked, MenuItemAdapter.ItemAction {
public static String video_id;
public static List<String> playedVideos = new ArrayList<>();
Uri captionURI;
String captionLang;
private String peertubeInstance, videoUuid;
private ImageView fullScreenIcon;
private boolean fullScreenMode;
@ -203,10 +205,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
private String currentCaption;
private boolean isRemote;
private boolean willPlayFromIntent;
private app.fedilab.fedilabtube.client.mastodon.Status status;
Uri captionURI;
String captionLang;
public static void hideKeyboard(Activity activity) {
if (activity != null && activity.getWindow() != null) {
@ -495,7 +494,6 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
});
}
private void manageVIewVideos(APIResponse apiResponse) {

View File

@ -14,6 +14,10 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.PEERTUBEDELETEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
@ -61,10 +65,6 @@ import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.PEERTUBEDELETEVIDEO;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class PeertubeEditUploadActivity extends AppCompatActivity {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.PICK_INSTANCE;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
@ -42,8 +44,6 @@ import app.fedilab.fedilabtube.helper.HelperAcadInstance;
import app.fedilab.fedilabtube.helper.HelperInstance;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.PICK_INSTANCE;
public class PeertubeRegisterActivity extends AppCompatActivity {
@ -71,11 +71,6 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
binding.titleLoginInstance.setVisibility(View.GONE);
}
if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
binding.loginInstance.setText("queermotion.org");
}else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) {
binding.loginInstance.setText("bittube.video");
}
binding.username.setOnFocusChangeListener((view, focused) -> {
if (!focused && binding.username.getText() != null) {

View File

@ -14,6 +14,10 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.userMe;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.Manifest;
import android.app.Activity;
import android.app.PendingIntent;
@ -62,10 +66,6 @@ import app.fedilab.fedilabtube.helper.HelperInstance;
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.userMe;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class PeertubeUploadActivity extends AppCompatActivity {

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.PeertubeActivity.hideKeyboard;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
@ -42,9 +45,6 @@ import app.fedilab.fedilabtube.databinding.ActivitySepiaSearchBinding;
import app.fedilab.fedilabtube.fragment.DisplaySepiaSearchFragment;
import app.fedilab.fedilabtube.helper.Helper;
import static app.fedilab.fedilabtube.PeertubeActivity.hideKeyboard;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class SepiaSearchActivity extends AppCompatActivity {

View File

@ -14,6 +14,10 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
@ -54,10 +58,6 @@ import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
public class ShowAccountActivity extends AppCompatActivity {

View File

@ -14,6 +14,15 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
@ -69,15 +78,6 @@ import app.fedilab.fedilabtube.viewmodel.RelationshipVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
public class ShowChannelActivity extends AppCompatActivity {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.HISTORY;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.Menu;
@ -38,8 +40,6 @@ import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.HISTORY;
public class VideosTimelineActivity extends AppCompatActivity {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.updateCredential;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
@ -23,6 +25,7 @@ import android.view.MenuItem;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
@ -40,13 +43,11 @@ import app.fedilab.fedilabtube.client.entities.Token;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.webview.CustomWebview;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.updateCredential;
public class WebviewConnectActivity extends AppCompatActivity {
private CustomWebview webView;
private WebView webView;
private AlertDialog alert;
private String clientId, clientSecret;
private String url;
@ -72,7 +73,7 @@ public class WebviewConnectActivity extends AppCompatActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
WebView.setWebContentsDebuggingEnabled(true);
setContentView(R.layout.activity_webview_connect);
Bundle b = getIntent().getExtras();
if (b != null) {
@ -87,11 +88,19 @@ public class WebviewConnectActivity extends AppCompatActivity {
webView = findViewById(R.id.webviewConnect);
clearCookies(WebviewConnectActivity.this);
webView.getSettings().setJavaScriptEnabled(true);
if (Build.VERSION.SDK_INT >= 21) {
CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true);
} else {
CookieManager.getInstance().setAcceptCookie(true);
}
CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setSupportZoom(true);
webView.getSettings().setDisplayZoomControls(false);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setSupportMultipleWindows(false);
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
webView.getSettings().setMediaPlaybackRequiresUserGesture(true);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle(R.string.login);
@ -112,7 +121,6 @@ public class WebviewConnectActivity extends AppCompatActivity {
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
Matcher matcher = Helper.redirectPattern.matcher(url);

View File

@ -97,6 +97,10 @@ import retrofit2.converter.gson.GsonConverterFactory;
@SuppressWarnings({"unused", "RedundantSuppression", "ConstantConditions"})
public class RetrofitPeertubeAPI {
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
private final String finalUrl;
private final Context _context;
private final String instance;
@ -106,12 +110,6 @@ public class RetrofitPeertubeAPI {
private Set<String> selection;
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
public RetrofitPeertubeAPI(Context context) {
_context = context;
instance = HelperInstance.getLiveInstance(context);

View File

@ -15,9 +15,8 @@ package app.fedilab.fedilabtube.client.entities;
* see <http://www.gnu.org/licenses>. */
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -42,14 +41,7 @@ public class AcadInstances {
public static List<AcadInstances> getInstances() {
List<AcadInstances> acadInstances = new ArrayList<>();
for (String academie : HelperAcadInstance.academies) {
AcadInstances acadInstance = new AcadInstances();
acadInstance.name = academie;
acadInstance.openId = !Arrays.asList(HelperAcadInstance.notOpenId).contains(academie);
acadInstance.url = getPeertubeUrl(academie);
acadInstances.add(acadInstance);
}
HashMap<String, String> instancesMap = new HashMap<>(HelperAcadInstance.instances_themes);
LinkedHashMap<String, String> instancesMap = new LinkedHashMap<>(HelperAcadInstance.instances_themes);
Iterator<Map.Entry<String, String>> it = instancesMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> pair = it.next();
@ -63,36 +55,6 @@ public class AcadInstances {
return acadInstances;
}
/**
* Returns the peertube URL depending of the academic domain name
*
* @param acad String academic domain name
* @return String the peertube URL
*/
private static String getPeertubeUrl(String acad) {
if (acad.compareTo("education.gouv.fr") == 0 || acad.compareTo("igesr.gouv.fr") == 0) {
acad = "education.fr";
} else if (acad.compareTo("ac-nancy-metz.fr") == 0) {
acad = "ac-nancy.fr";
} else if (acad.compareTo("clermont.fr") == 0) {
acad = "clermont-ferrand.fr";
} else if (acad.compareTo("ac-wf.wf") == 0 || acad.compareTo("ac-mayotte.fr") == 0 || acad.compareTo("ac-noumea.nc") == 0
|| acad.compareTo("ac-guadeloupe.fr") == 0 || acad.compareTo("monvr.pf") == 0 || acad.compareTo("ac-reunion.fr") == 0 ||
acad.compareTo("ac-martinique.fr") == 0 || acad.compareTo("ac-guyane.fr") == 0
) {
acad = "outremer.fr";
}
if (!acad.contains("ac-lyon.fr")) {
//TODO: remove hack for test with openid
/*if( acad.contains("orleans-tours.fr")) {
return "tube-normandie.beta.education.fr";
}*/
return "tube-" + acad.replaceAll("ac-|\\.fr", "") + ".beta.education.fr";
} else {
return "tube.ac-lyon.fr";
}
}
public String getName() {
return name;

View File

@ -29,6 +29,18 @@ import app.fedilab.fedilabtube.client.entities.Avatar;
public class MastodonAccount {
public static AccountData.Account convertToPeertubeAccount(MastodonAccount.Account initialAccount) {
AccountData.Account account = new AccountData.Account();
Avatar avatar = new Avatar();
avatar.setPath(initialAccount.getAvatar());
account.setAvatar(avatar);
account.setDescription(initialAccount.getDescription());
account.setDisplayName(initialAccount.getDisplayName());
account.setUsername(initialAccount.getUsername());
account.setHost(initialAccount.getHost());
return account;
}
public static class Account implements Parcelable {
public static final Creator<Account> CREATOR = new Creator<Account>() {
@Override
@ -240,16 +252,4 @@ public class MastodonAccount {
dest.writeString(this.url);
}
}
public static AccountData.Account convertToPeertubeAccount(MastodonAccount.Account initialAccount) {
AccountData.Account account = new AccountData.Account();
Avatar avatar = new Avatar();
avatar.setPath(initialAccount.getAvatar());
account.setAvatar(avatar);
account.setDescription(initialAccount.getDescription());
account.setDisplayName(initialAccount.getDisplayName());
account.setUsername(initialAccount.getUsername());
account.setHost(initialAccount.getHost());
return account;
}
}

View File

@ -45,17 +45,33 @@ import retrofit2.converter.gson.GsonConverterFactory;
public class RetrofitMastodonAPI {
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
private final String finalUrl;
private final String finalUrl2;
private final Context _context;
private String instance;
private String token;
public RetrofitMastodonAPI(Context context) {
_context = context;
SharedPreferences sharedpreferences = _context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
this.instance = sharedpreferences.getString(Helper.PREF_REMOTE_INSTANCE, null);
this.token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
finalUrl = "https://" + this.instance + "/api/v1/";
finalUrl2 = "https://" + this.instance + "/api/v2/";
}
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
public RetrofitMastodonAPI(Context context, String instance, String token) {
_context = context;
this.instance = instance;
this.token = token;
finalUrl = "https://" + instance + "/api/v1/";
finalUrl2 = "https://" + this.instance + "/api/v2/";
}
public Status search(String url) throws Error {
MastodonService mastodonService2 = init2();
@ -81,24 +97,6 @@ public class RetrofitMastodonAPI {
return null;
}
public RetrofitMastodonAPI(Context context) {
_context = context;
SharedPreferences sharedpreferences = _context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
this.instance = sharedpreferences.getString(Helper.PREF_REMOTE_INSTANCE, null);
this.token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
finalUrl = "https://" + this.instance + "/api/v1/";
finalUrl2 = "https://" + this.instance + "/api/v2/";
}
public RetrofitMastodonAPI(Context context, String instance, String token) {
_context = context;
this.instance = instance;
this.token = token;
finalUrl = "https://" + instance + "/api/v1/";
finalUrl2 = "https://" + this.instance + "/api/v2/";
}
public void updateCredential(Activity activity, String client_id, String client_secret, String refresh_token, String software) {
new Thread(() -> {
MastodonAccount.Account account;
@ -340,6 +338,13 @@ public class RetrofitMastodonAPI {
return null;
}
private String getToken() {
if (token != null) {
return "Bearer " + token;
} else {
return null;
}
}
public enum actionType {
BOOST,
@ -349,12 +354,4 @@ public class RetrofitMastodonAPI {
BOOKMARK,
UNBOOKMARK
}
private String getToken() {
if (token != null) {
return "Bearer " + token;
} else {
return null;
}
}
}

View File

@ -15,6 +15,8 @@ package app.fedilab.fedilabtube.drawer;
* see <http://www.gnu.org/licenses>. */
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
@ -45,8 +47,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import app.fedilab.fedilabtube.sqlite.StoredInstanceDAO;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
@ -64,9 +67,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -15,6 +15,10 @@ package app.fedilab.fedilabtube.drawer;
* see <http://www.gnu.org/licenses>. */
import static android.app.Activity.RESULT_OK;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@ -41,10 +45,6 @@ import app.fedilab.fedilabtube.client.data.InstanceData.Instance;
import app.fedilab.fedilabtube.databinding.DrawerInstanceBinding;
import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
import static android.app.Activity.RESULT_OK;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -14,6 +14,11 @@ package app.fedilab.fedilabtube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.MY_VIDEOS;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
@ -70,11 +75,6 @@ import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import jp.wasabeef.glide.transformations.BlurTransformation;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.MY_VIDEOS;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.MainActivity.badgeCount;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@ -45,8 +47,6 @@ import app.fedilab.fedilabtube.fragment.DisplayNotificationsFragment;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.helper.HelperInstance;
import static app.fedilab.fedilabtube.MainActivity.badgeCount;
public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.drawer;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.viewmodel.PlaylistsVM.action.GET_LIST_VIDEOS;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
@ -72,8 +74,6 @@ import app.fedilab.fedilabtube.sqlite.Sqlite;
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.viewmodel.PlaylistsVM.action.GET_LIST_VIDEOS;
public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.fragment;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
@ -63,8 +65,6 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import app.fedilab.fedilabtube.viewmodel.SearchVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
public class DisplayChannelsFragment extends Fragment implements ChannelListAdapter.AllChannelRemoved, ChannelListAdapter.EditAlertDialog {

View File

@ -14,6 +14,10 @@ package app.fedilab.fedilabtube.fragment;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.CATEGORY;
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.CHANNEL;
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.TAG;
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
@ -52,10 +56,6 @@ import app.fedilab.fedilabtube.viewmodel.RelationshipVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.CATEGORY;
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.CHANNEL;
import static app.fedilab.fedilabtube.client.data.VideoData.Video.titleType.TAG;
public class DisplayOverviewFragment extends Fragment implements PeertubeAdapter.RelationShipListener, PeertubeAdapter.PlaylistListener {

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube.fragment;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@ -64,9 +67,6 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class DisplayPlaylistsFragment extends Fragment {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.fragment;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Rect;
@ -49,8 +51,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.viewmodel.SepiaSearchVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
public class DisplaySepiaSearchFragment extends Fragment implements AccountsHorizontalListAdapter.EventListener {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.fragment;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.VIDEOS_IN_LOCAL_PLAYLIST;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Rect;
@ -62,8 +64,6 @@ import app.fedilab.fedilabtube.viewmodel.SearchVM;
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.VIDEOS_IN_LOCAL_PLAYLIST;
public class DisplayVideosFragment extends Fragment implements AccountsHorizontalListAdapter.EventListener, PeertubeAdapter.RelationShipListener, PeertubeAdapter.PlaylistListener {

View File

@ -1,5 +1,7 @@
package app.fedilab.fedilabtube.fragment;
import static app.fedilab.fedilabtube.MainActivity.userMe;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -45,8 +47,6 @@ import app.fedilab.fedilabtube.helper.HelperInstance;
import app.fedilab.fedilabtube.helper.ThemeHelper;
import es.dmoral.toasty.Toasty;
import static app.fedilab.fedilabtube.MainActivity.userMe;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of TubeLab

View File

@ -14,6 +14,9 @@ package app.fedilab.fedilabtube.helper;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static android.content.Context.DOWNLOAD_SERVICE;
import static android.content.Context.MODE_PRIVATE;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.DownloadManager;
@ -76,9 +79,6 @@ import app.fedilab.fedilabtube.webview.ProxyHelper;
import es.dmoral.toasty.Toasty;
import jp.wasabeef.glide.transformations.BlurTransformation;
import static android.content.Context.DOWNLOAD_SERVICE;
import static android.content.Context.MODE_PRIVATE;
public class Helper {
public static final int RELOAD_MYVIDEOS = 10;
@ -135,7 +135,6 @@ public class Helper {
public static final String VIDEO_ID = "video_id_update";
public static final String APP_PREFS = "app_prefs";
public static final String CAST_ID = "D402501A";
public static final String CAST_ID_BITTUBE = "CBA4A31D";
public static final int VIDEOS_PER_PAGE = 10;
public static final String RECEIVE_ACTION = "receive_action";
public static final String SET_UNFOLLOW_VALIDATION = "set_unfollow_validation";

View File

@ -14,15 +14,13 @@ package app.fedilab.fedilabtube.helper;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
public class HelperAcadInstance {
public static Map<String, String> instances_themes;
public static String LOCAL = "LOCALES";
public static String DISCOVER = "DECOUVRIR";
public static String MOSTLIKED = "PLUS_APPRECIEES";
@ -31,64 +29,7 @@ public class HelperAcadInstance {
public static String HISTORY = "HISTORIQUE";
public static String SUBSCRIPTIONS = "ABONNEMENTS";
public static String MYVIDEOS = "VIDEOS";
public static String[] notOpenId = {
"ac-aix-marseille.fr",
"ac-amiens.fr",
"ac-besancon.fr",
"ac-bordeaux.fr",
"clermont-ferrand.fr",
"ac-corse.fr",
"ac-creteil.fr",
"ac-dijon.fr",
"ac-grenoble.fr",
"ac-lille.fr",
"ac-limoges.fr",
"ac-lyon.fr",
"ac-mayotte.fr",
"ac-montpellier.fr",
"ac-nancy.fr",
"ac-nantes.fr",
"ac-orleans-tours.fr",
"ac-paris.fr",
"ac-poitiers.fr",
"outremer.fr",
"ac-rennes.fr",
"ac-strasbourg.fr",
"ac-toulouse.fr",
"ac-versailles.fr"
};
public static String[] academies = {
"ac-aix-marseille.fr",
"ac-amiens.fr",
"ac-besancon.fr",
"ac-bordeaux.fr",
"clermont-ferrand.fr",
"ac-corse.fr",
"ac-creteil.fr",
"ac-dijon.fr",
"ac-grenoble.fr",
"education.fr",
"ac-lille.fr",
"ac-limoges.fr",
"ac-lyon.fr",
"ac-mayotte.fr",
"ac-montpellier.fr",
"ac-nancy.fr",
"ac-nantes.fr",
"ac-normandie.fr",
"ac-orleans-tours.fr",
"ac-paris.fr",
"ac-poitiers.fr",
"outremer.fr",
"ac-rennes.fr",
"ac-strasbourg.fr",
"ac-toulouse.fr",
"ac-versailles.fr"
};
public static String openIdURL = "https://auth.apps.education.fr/auth/realms/apps/protocol/openid-connect/auth?";
//List of available emails
public static String[] valideEmails = {
@ -130,20 +71,34 @@ public class HelperAcadInstance {
};
public static LinkedHashMap<String, String> instances_themes;
public static HashMap<String, String> instance_client_id;
static {
Map<String, String> is = new LinkedHashMap<>();
//TODO: remove comments when instances will be available
is.put("Enseignement professionnel", "tube-enseignement-professionnel.apps.education.fr");
is.put("Action éducative", "tube-action-educative.apps.education.fr");
is.put("Numérique éducatif", "tube-numerique-educatif.apps.education.fr");
is.put("Institutionnel", "tube-institutionnelle.apps.education.fr");
is.put("2d - langues vivantes", "tube-2d-langues-vivantes.apps.education.fr");
is.put("2d - éducation physique et sportive", "tube-2d-education-physique-et-sportive.apps.education.fr");
is.put("2d - arts, lettres et sciences humaines", "tube-2d-arts-lettres-sciences-humaines.apps.education.fr");
is.put("Maternelle", "tube-maternelle.apps.education.fr");
is.put("Cycle 2", "tube-cycle-2.apps.education.fr");
is.put("Cycle 3", "tube-cycle-3.apps.education.fr");
instances_themes = Collections.unmodifiableMap(is);
instances_themes = new LinkedHashMap<>();
instances_themes.put("Institutionnel Éducatif", "tube-institutionnel.apps.education.fr");
instances_themes.put("Maternelle Éducatif", "tube-maternelle.apps.education.fr");
instances_themes.put("Art & Sciences Humaines", "tube-arts-lettres-sciences-humaines.apps.education.fr");
instances_themes.put("Sciences & Technologies", "tube-sciences-technologies.apps.education.fr");
instances_themes.put("Éducation Physique & Sportive", "tube-education-physique-et-sportive.apps.education.fr");
instances_themes.put("Enseignement Professionnel", "tube-enseignement-professionnel.apps.education.fr");
instances_themes.put("Langues Vivantes", "tube-langues-vivantes.apps.education.fr");
instances_themes.put("Action Éducative", "tube-action-educative.apps.education.fr");
instances_themes.put("Cycle-2 Éducatif", "tube-cycle-2.apps.education.fr");
instances_themes.put("Cycle-3 Éducatif", "tube-cycle-3.apps.education.fr");
}
static {
instance_client_id = new HashMap<>();
instance_client_id.put("tube-institutionnel.apps.education.fr", "tube-institutionnel");
instance_client_id.put("tube-maternelle.apps.education.fr", "tube-maternelle");
instance_client_id.put("tube-arts-lettres-sciences-humaines.apps.education.fr", "tube-arts-lettres-sciences-humaines");
instance_client_id.put("tube-sciences-technologies.apps.education.fr", "tube-sciences-technologies");
instance_client_id.put("tube-education-physique-et-sportive.apps.education.fr", "tube-education-physique-et-sportive");
instance_client_id.put("tube-enseignement-professionnel.apps.education.fr", "tube-enseignement-professionnel");
instance_client_id.put("tube-langues-vivantes.apps.education.fr", "tube-langues-vivantes");
instance_client_id.put("tube-action-educative.apps.education.fr", "tube-action-educative");
instance_client_id.put("tube-cycle-2.apps.education.fr", "tube-cycle-2");
instance_client_id.put("tube-cycle-3.apps.education.fr", "tube-cycle-3");
}
}

View File

@ -34,10 +34,6 @@ public class HelperInstance {
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
if (BuildConfig.FLAVOR.compareTo("fdroid_full") == 0 || BuildConfig.FLAVOR.compareTo("google_full") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, getDefaultInstance());
} else if (BuildConfig.FLAVOR.compareTo("bittube") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "bittube.video");
} else if (BuildConfig.FLAVOR.compareTo("queermotion") == 0) {
return sharedpreferences.getString(Helper.PREF_INSTANCE, "queermotion.org");
} else {
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
if (!instance.startsWith("tube")) {

View File

@ -15,6 +15,8 @@ package app.fedilab.fedilabtube.helper;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.worker.NotificationsWorker.FETCH_NOTIFICATION_CHANNEL_ID;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@ -31,8 +33,6 @@ import androidx.core.app.NotificationManagerCompat;
import app.fedilab.fedilabtube.R;
import app.fedilab.fedilabtube.client.data.AccountData;
import static app.fedilab.fedilabtube.worker.NotificationsWorker.FETCH_NOTIFICATION_CHANNEL_ID;
public class NotificationHelper {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.helper;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static android.content.Context.MODE_PRIVATE;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
@ -31,8 +33,6 @@ import app.fedilab.fedilabtube.drawer.OwnAccountsAdapter;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import static android.content.Context.MODE_PRIVATE;
public class SwitchAccountHelper {

View File

@ -14,13 +14,13 @@ package app.fedilab.fedilabtube.helper;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.helper.Helper.DARK_MODE;
import static app.fedilab.fedilabtube.helper.Helper.LIGHT_MODE;
import android.os.Build;
import androidx.appcompat.app.AppCompatDelegate;
import static app.fedilab.fedilabtube.helper.Helper.DARK_MODE;
import static app.fedilab.fedilabtube.helper.Helper.LIGHT_MODE;
public class ThemeHelper {
public static void switchTo(int themePref) {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.services;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@ -36,8 +38,6 @@ import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
import app.fedilab.fedilabtube.helper.EmojiHelper;
import app.fedilab.fedilabtube.helper.NetworkStateReceiver;
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
public class RetrieveInfoService extends Service implements NetworkStateReceiver.NetworkStateReceiverListener {

View File

@ -22,8 +22,8 @@ import android.database.sqlite.SQLiteDatabase;
import java.util.Date;
import app.fedilab.fedilabtube.client.mastodon.MastodonAccount.Account;
import app.fedilab.fedilabtube.client.entities.Token;
import app.fedilab.fedilabtube.client.mastodon.MastodonAccount.Account;
import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.helper.HelperInstance;
@ -200,8 +200,6 @@ public class MastodonAccountDAO {
}
/**
* Test if the current user is already stored in data base
*
@ -218,5 +216,4 @@ public class MastodonAccountDAO {
}
}

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.viewmodel;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static android.content.Context.MODE_PRIVATE;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
@ -26,7 +28,6 @@ import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import app.fedilab.fedilabtube.AccountActivity;
import app.fedilab.fedilabtube.client.APIResponse;
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
import app.fedilab.fedilabtube.client.data.AccountData;
@ -34,8 +35,6 @@ import app.fedilab.fedilabtube.helper.Helper;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import static android.content.Context.MODE_PRIVATE;
public class ChannelsVM extends AndroidViewModel {
private MutableLiveData<APIResponse> apiResponseMutableLiveData;

View File

@ -16,7 +16,6 @@ package app.fedilab.fedilabtube.viewmodel;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;
import android.os.Looper;

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.viewmodel;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static app.fedilab.fedilabtube.viewmodel.PlaylistsVM.action.GET_LIST_VIDEOS;
import android.app.Application;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
@ -38,8 +40,6 @@ import app.fedilab.fedilabtube.helper.HelperInstance;
import app.fedilab.fedilabtube.sqlite.ManagePlaylistsDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import static app.fedilab.fedilabtube.viewmodel.PlaylistsVM.action.GET_LIST_VIDEOS;
public class TimelineVM extends AndroidViewModel {
private MutableLiveData<APIResponse> apiResponseMutableLiveData;
@ -125,10 +125,7 @@ public class TimelineVM extends AndroidViewModel {
private void getSingle(String instance, String videoId, boolean myVideo) {
Context _mContext = getApplication().getApplicationContext();
boolean canUseToken = false;
if (instance == null || instance.compareTo(HelperInstance.getLiveInstance(_mContext)) == 0) {
canUseToken = true;
}
boolean canUseToken = instance == null || instance.compareTo(HelperInstance.getLiveInstance(_mContext)) == 0;
boolean finalCanUseToken = canUseToken;
new Thread(() -> {
try {

View File

@ -14,6 +14,8 @@ package app.fedilab.fedilabtube.worker;
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
* see <http://www.gnu.org/licenses>. */
import static android.content.Context.NOTIFICATION_SERVICE;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
@ -57,8 +59,6 @@ import app.fedilab.fedilabtube.helper.NotificationHelper;
import app.fedilab.fedilabtube.sqlite.AccountDAO;
import app.fedilab.fedilabtube.sqlite.Sqlite;
import static android.content.Context.NOTIFICATION_SERVICE;
public class NotificationsWorker extends Worker {
public static String FETCH_NOTIFICATION_CHANNEL_ID = "fetch_notification_peertube";

View File

@ -30,7 +30,7 @@
android:layout_height="10dp"
android:padding="2dp" />
<app.fedilab.fedilabtube.webview.CustomWebview
<WebView
android:id="@+id/webviewConnect"
android:layout_width="match_parent"
android:layout_height="0dp"