Merge branch 'development'

This commit is contained in:
ivan agosto 2018-09-15 16:30:50 -05:00
commit 95a9c717f6
113 changed files with 3577 additions and 1 deletions

2
.gitignore vendored
View File

@ -30,3 +30,5 @@ proguard/
# Android Studio captures folder
captures/
\.idea/

19
P2Play.iml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="p2play" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1 +1,53 @@
P2Play
# P2Play
P2Play is an Android Application for Peertube.
[What is Peertube?](https://github.com/Chocobozzz/PeerTube/)
## Documentation
Comming soon!
## Realeases
[All realeases are here](https://gitlab.com/agosto182/p2play/tags)
## Features
- Show recent, popular and local list of videos.
- Reproduce videos (very simple)
- Login and register in your instance
- Pull to refresh
- Show uploaded videos
## What to do? (in next version)
- Search videos
- Show and make commentaries
- Subscribe to accounts
- Show your subscripcion videos
- Rate and share videos
## Demostrations
Demostration P2Play Beta 0.1: [https://peertube.video/videos/watch/2eb7b953-0b1b-4019-9300-817539f5f4e8](https://peertube.video/videos/watch/2eb7b953-0b1b-4019-9300-817539f5f4e8)
[Spanish] Demostracion P2Play Beta 0.1: [https://peertube.video/videos/watch/d6a7da26-d3dd-43aa-ad5c-7d032603c848](https://peertube.video/videos/watch/d6a7da26-d3dd-43aa-ad5c-7d032603c848)
## Contact
You can follow our accounts for get news and contact with the developers.
- GNU Social: [https://gnusocial.ml/p2play](https://gnusocial.ml/p2play)
- Peertube Channel: [https://peertube.video/video-channels/90df4e5f-c834-4720-a5d7-c9faa0af0af5/videos](https://peertube.video/video-channels/90df4e5f-c834-4720-a5d7-c9faa0af0af5/videos)
## About
P2Play is made in Android Studio with Kotlin code.
<img src="https://weblizar.com/blog/wp-content/uploads/2017/11/Kotlin-A-New-Programming-Platform-For-Android-Developers.png" width="200px">
### Developers
- Ivan Agosto: [https://gnusocial.ml/agosto182](https://gnusocial.ml/agosto182)
## License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see [license](./LICENSE.md)

BIN
app/.DS_Store vendored Normal file

Binary file not shown.

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

190
app/app.iml Normal file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.6" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
<option name="destination" value="$MODULE_DIR$/build/tmp/kotlin-classes/debug" />
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
<option name="moduleName" value="app_debug" />
<option name="addCompilerBuiltIns" value="true" />
<option name="loadBuiltInsFromDependencies" value="true" />
<option name="languageVersion" value="1.2" />
<option name="apiVersion" value="1.2" />
<option name="pluginOptions">
<array>
<option value="plugin:org.jetbrains.kotlin.android:experimental=false" />
<option value="plugin:org.jetbrains.kotlin.android:enabled=true" />
<option value="plugin:org.jetbrains.kotlin.android:defaultCacheImplementation=hashMap" />
</array>
</option>
<option name="pluginClasspaths">
<array>
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-android-extensions/1.2.51/1755c607e5fabf4ba949ef626c73fc7421d35123/kotlin-android-extensions-1.2.51.jar" />
</array>
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/build-info" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-main-apk-res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/kotlin" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 27 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: com.android.support:transition-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-v4-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:runner-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:common:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:27.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-compat-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.2.51@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:viewmodel-1.1.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:recyclerview-v7-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-media-compat-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-1.1.2" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-core-3.0.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.51@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:runtime-1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.51@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:design-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:monitor-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-idling-resource-3.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.10.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.2@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:exifinterface-27.1.0" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core-1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.picasso:picasso-2.71828" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime-1.1.0" level="project" />
</component>
</module>

41
app/build.gradle Normal file
View File

@ -0,0 +1,41 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
applicationId "org.libre.agosto.p2play"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '27.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

21
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

BIN
app/src/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
package org.libre.agosto.p2play
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("org.libre.agosto.p2play", appContext.packageName)
}
}

BIN
app/src/main/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libre.agosto.p2play">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_p2play"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_p2play"
android:supportsRtl="true"
android:theme="@style/P2playTheme">
<activity android:name=".HostActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:theme="@style/P2playTheme.NoActionBar" />
<activity android:name=".ReproductorActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" />
<activity android:name=".AboutActivity" />
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"></activity>
</application>
</manifest>

View File

@ -0,0 +1,16 @@
package org.libre.agosto.p2play
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.text.method.LinkMovementMethod
import kotlinx.android.synthetic.main.activity_about.*
class AboutActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)
aboutUrl.text = "https://"+ManagerSingleton.url+"/about/instance"
}
}

View File

@ -0,0 +1,90 @@
package org.libre.agosto.p2play
import android.content.res.Configuration
import android.os.Bundle
import android.preference.PreferenceActivity
import android.support.annotation.LayoutRes
import android.support.v7.app.ActionBar
import android.support.v7.app.AppCompatDelegate
import android.support.v7.widget.Toolbar
import android.view.MenuInflater
import android.view.View
import android.view.ViewGroup
/**
* A [android.preference.PreferenceActivity] which implements and proxies the necessary calls
* to be used with AppCompat.
*/
abstract class AppCompatPreferenceActivity : PreferenceActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
delegate.installViewFactory()
delegate.onCreate(savedInstanceState)
super.onCreate(savedInstanceState)
}
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
delegate.onPostCreate(savedInstanceState)
}
val supportActionBar: ActionBar?
get() = delegate.supportActionBar
fun setSupportActionBar(toolbar: Toolbar?) {
delegate.setSupportActionBar(toolbar)
}
override fun getMenuInflater(): MenuInflater {
return delegate.menuInflater
}
override fun setContentView(@LayoutRes layoutResID: Int) {
delegate.setContentView(layoutResID)
}
override fun setContentView(view: View) {
delegate.setContentView(view)
}
override fun setContentView(view: View, params: ViewGroup.LayoutParams) {
delegate.setContentView(view, params)
}
override fun addContentView(view: View, params: ViewGroup.LayoutParams) {
delegate.addContentView(view, params)
}
override fun onPostResume() {
super.onPostResume()
delegate.onPostResume()
}
override fun onTitleChanged(title: CharSequence, color: Int) {
super.onTitleChanged(title, color)
delegate.setTitle(title)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
delegate.onConfigurationChanged(newConfig)
}
override fun onStop() {
super.onStop()
delegate.onStop()
}
override fun onDestroy() {
super.onDestroy()
delegate.onDestroy()
}
override fun invalidateOptionsMenu() {
delegate.invalidateOptionsMenu()
}
private val delegate: AppCompatDelegate by lazy {
AppCompatDelegate.create(this, null)
}
}

View File

@ -0,0 +1,125 @@
package org.libre.agosto.p2play
import android.content.ContentValues
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteException
import android.database.sqlite.SQLiteOpenHelper
import org.libre.agosto.p2play.models.TokenModel
import org.libre.agosto.p2play.models.UserModel
class Database(context:Context): SQLiteOpenHelper(context,"p2play",null,1) {
val dbName = "p2play"
private val dbUsers = "CREATE TABLE users(id INTEGER PRIMARY KEY AUTOINCREMENT, uuid INTEGER, username varchar(30), " +
"nsfw INTEGER, email string, followers INTEGER, avatar string, status integer)"
private val dbTokens = "CREATE TABLE tokens(id INTEGER PRIMARY KEY AUTOINCREMENT, token STRING, refresh_token STRING, status INTEGER)"
override fun onCreate(db: SQLiteDatabase?) {
db?.execSQL(dbUsers)
db?.execSQL(dbTokens)
}
override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
db?.execSQL("DROP TABLE users")
db?.execSQL("DROP TABLE tokens")
onCreate(db)
}
fun newToken(token: TokenModel): Boolean {
val db = writableDatabase
this.closeTokens()
val newToken=ContentValues()
newToken.put("token", token.token)
newToken.put("refresh_token", token.refresh_token)
newToken.put("status", token.status)
db.insert("tokens",null,newToken)
return true
}
fun newUser(user: UserModel): Boolean {
val db = writableDatabase
this.closeUsers()
val newUser=ContentValues()
newUser.put("uuid", user.uuid)
newUser.put("username", user.username)
newUser.put("email", user.email)
newUser.put("nsfw", user.nsfw)
newUser.put("followers", user.followers)
newUser.put("avatar", user.avatar)
newUser.put("status", user.status)
db.insert("users",null, newUser)
return true
}
fun getToken(): TokenModel{
val db = writableDatabase
var token = TokenModel()
try {
var cursor= db.rawQuery("SELECT * FROM tokens WHERE status=1 ORDER BY id DESC LIMIT 1",null)
cursor.moveToFirst()
token.token = cursor.getString(cursor.getColumnIndex("token")).toString()
token.refresh_token = cursor.getString(cursor.getColumnIndex("refresh_token")).toString()
token.status = cursor.getString(cursor.getColumnIndex("status")).toInt()
cursor.close()
return token
}catch (e:SQLiteException){
db?.execSQL(dbTokens)
}catch (e:Exception){
e.printStackTrace()
}
return token
}
fun getUser(): UserModel{
val db = writableDatabase
var user = UserModel()
try {
var cursor= db.rawQuery("SELECT * FROM users WHERE status=1 ORDER BY id DESC LIMIT 1",null)
cursor.moveToFirst()
user.uuid = cursor.getString(cursor.getColumnIndex("uuid")).toInt()
user.username = cursor.getString(cursor.getColumnIndex("username")).toString()
user.email = cursor.getString(cursor.getColumnIndex("email")).toString()
user.nsfw = cursor.getString(cursor.getColumnIndex("nsfw")).toBoolean()
user.followers = cursor.getString(cursor.getColumnIndex("followers")).toInt()
user.avatar = cursor.getString(cursor.getColumnIndex("avatar")).toString()
user.status = cursor.getString(cursor.getColumnIndex("status")).toInt()
cursor.close()
return user
}catch (e:SQLiteException){
db?.execSQL(dbTokens)
}catch (e:Exception){
e.printStackTrace()
}
return user
}
private fun closeTokens(){
val db = writableDatabase
db.execSQL("UPDATE tokens SET status=-1 WHERE 1")
}
private fun closeUsers(){
val db = writableDatabase
db.execSQL("UPDATE users SET status=-1 WHERE 1")
}
fun logout(){
closeUsers()
closeTokens()
}
}

View File

@ -0,0 +1,116 @@
package org.libre.agosto.p2play
import android.content.Intent
import android.content.SharedPreferences
import android.os.AsyncTask
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.os.Looper
import android.preference.PreferenceManager
import android.util.Log
import kotlinx.android.synthetic.main.activity_host.*
import org.libre.agosto.p2play.ajax.Auth
import org.libre.agosto.p2play.ajax.Client
class HostActivity : AppCompatActivity() {
lateinit var settings: SharedPreferences
lateinit var editor: SharedPreferences.Editor
val client:Auth = Auth()
val _db = Database(this)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_host)
settings = PreferenceManager.getDefaultSharedPreferences(this)
editor = settings.edit()
ManagerSingleton.context = this
button.setOnClickListener {
getKeys(hostText.text.toString())
}
val host = settings.getString("hostP2play","")
val lastHost = settings.getString("last_host","")
if(host!=""){
if(lastHost!=host){
_db.logout()
getKeys(host)
}else{
ManagerSingleton.url=host
checkUser()
}
}
}
fun checkUser(){
val token = _db.getToken()
val user = _db.getUser()
AsyncTask.execute {
if (Looper.myLooper() == null)
Looper.prepare()
if (token.status == 1 && user.status == 1) {
startApp()
val client_id = settings.getString("client_id", "")
val client_secret = settings.getString("client_secret", "")
val newToken = client.refreshToken(token, client_id, client_secret)
when (token.status.toString()) {
"1" -> {
_db.newToken(newToken)
ManagerSingleton.token = newToken
ManagerSingleton.user = user
}
else -> _db.logout()
}
} else {
_db.logout()
}
this.finish()
}
}
fun saveHost(host: String){
editor.putString("last_host",host)
editor.putString("hostP2play",host)
editor.apply()
ManagerSingleton.Toast(getString(R.string.finallyMsg))
ManagerSingleton.url=host
checkUser()
}
private fun getKeys(hostText: String){
button.isEnabled = false
var host = hostText.toString()
host = host.replace("http://","")
host = host.replace("https://","")
host = host.replace("/","")
ManagerSingleton.url = host
AsyncTask.execute {
if (Looper.myLooper()==null)
Looper.prepare()
val keys = client.getKeys()
if(keys.client_id!=""){
editor.putString("client_id",keys.client_id)
editor.putString("client_secret",keys.client_secret)
editor.apply()
saveHost(host)
}
else{
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.errorMsg))
button.isEnabled = true
}
}
}
}
private fun startApp(){
runOnUiThread {
val intent = Intent(ManagerSingleton.context,MainActivity::class.java)
startActivity(intent)
}
}
}

View File

@ -0,0 +1,89 @@
package org.libre.agosto.p2play
import android.content.Intent
import android.content.SharedPreferences
import android.os.AsyncTask
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.os.Looper
import android.preference.PreferenceManager
import android.util.Log
import kotlinx.android.synthetic.main.activity_login.*
import org.libre.agosto.p2play.ajax.Auth
class LoginActivity : AppCompatActivity() {
private val _auth = Auth()
lateinit var settings: SharedPreferences
lateinit var client_id: String
lateinit var client_secret: String
private lateinit var _db: Database
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
setTitle(R.string.action_login)
ManagerSingleton.context = this
_db = Database(this)
settings = PreferenceManager.getDefaultSharedPreferences(this)
client_id = settings.getString("client_id", "")
client_secret = settings.getString("client_secret", "")
registerActionBtn.setOnClickListener { startActivity(Intent(this, RegisterActivity::class.java)) }
loginBtn.setOnClickListener { tryLogin() }
}
fun tryLogin(){
loginBtn.isEnabled = false;
val username = userText.text.toString()
val password = passwordText.text.toString()
AsyncTask.execute {
if (Looper.myLooper()==null)
Looper.prepare()
val token = _auth.login(username, password, client_id, client_secret)
// Log.d("token", token.token )
// Log.d("status", token.status.toString() )
when(token.status.toString()){
"1" -> {
_db.newToken(token)
ManagerSingleton.token = token
getUser()
}
"0" -> {
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.loginError_msg))
}
}
"-1" -> {
runOnUiThread {
loginBtn.isEnabled = true
ManagerSingleton.Toast(getString(R.string.loginFailed_msg))
}
}
}
}
}
fun getUser(){
val user = _auth.me(ManagerSingleton.token.token)
if(user.status == 1){
_db.newUser(user)
ManagerSingleton.user = user
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.loginSuccess_msg))
finish()
}
}
else{
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.loginError_msg))
}
}
}
}

View File

@ -0,0 +1,266 @@
package org.libre.agosto.p2play
import android.content.Intent
import android.os.AsyncTask
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.design.widget.NavigationView
import android.support.v4.view.GravityCompat
import android.support.v7.app.ActionBarDrawerToggle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.widget.ImageView
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.app_bar_main.*
import kotlinx.android.synthetic.main.content_main.*
import kotlinx.android.synthetic.main.nav_header_main.*
import org.libre.agosto.p2play.adapters.VideosAdapter
import org.libre.agosto.p2play.ajax.Videos
import org.libre.agosto.p2play.models.VideoModel
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
private lateinit var recyclerView: RecyclerView
private lateinit var viewAdapter: RecyclerView.Adapter<*>
private lateinit var viewManager: RecyclerView.LayoutManager
val client: Videos = Videos()
private lateinit var lastItem: MenuItem
lateinit var myMenu: Menu
val _db = Database(this)
var section: String = ""
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)
/* fab.setOnClickListener { view ->
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show()
} */
val toggle = ActionBarDrawerToggle(
this, drawer_layout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close)
drawer_layout.addDrawerListener(toggle)
toggle.syncState()
// Context for ManagerSingleton
ManagerSingleton.context = this
nav_view.setNavigationItemSelectedListener(this)
viewManager = LinearLayoutManager(this)
// Set data for RecyclerView
this.setData(arrayListOf())
this.getLastVideos()
swipeContainer.setOnRefreshListener {
this.refresh()
}
}
// Generic function for set data to RecyclerView
fun setData(data:ArrayList<VideoModel>){
viewAdapter = VideosAdapter(data)
recyclerView = findViewById<RecyclerView>(R.id.list).apply {
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
setHasFixedSize(true)
// use a linear layout manager
layoutManager = viewManager
// specify an viewAdapter (see also next example)
adapter = viewAdapter
}
swipeContainer.isRefreshing = false
}
fun refresh(){
swipeContainer.isRefreshing = true
when(section){
"local" -> this.getLocalVideos()
"popular" -> this.getPopularVideos()
"last" -> this.getLastVideos()
"my_videos" -> {
if(ManagerSingleton.token.token != "")
this.getMyVideos()
else
this.getLastVideos()
}
}
}
// Last videos
fun getLastVideos(){
swipeContainer.isRefreshing = true
section = "last"
setTitle(R.string.title_recent)
AsyncTask.execute {
val videos = client.getLastVideos()
runOnUiThread {
this.setData(videos)
}
}
}
//
fun getPopularVideos(){
swipeContainer.isRefreshing = true
section = "popular"
setTitle(R.string.title_popular)
AsyncTask.execute {
val videos = client.getPopularVideos()
runOnUiThread {
this.setData(videos)
}
}
}
fun getLocalVideos(){
swipeContainer.isRefreshing = true
section = "local"
setTitle(R.string.title_local)
AsyncTask.execute {
val videos = client.getLocalVideos()
runOnUiThread {
this.setData(videos)
}
}
}
fun getMyVideos(){
swipeContainer.isRefreshing = true
section = "my_videos"
setTitle(R.string.title_myVideos)
AsyncTask.execute {
val videos = client.myVideos(ManagerSingleton.token.token)
runOnUiThread {
this.setData(videos)
}
}
}
override fun onBackPressed() {
if (drawer_layout.isDrawerOpen(GravityCompat.START)) {
drawer_layout.closeDrawer(GravityCompat.START)
} else {
super.onBackPressed()
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(R.menu.main, menu)
myMenu = menu
setSideData()
return true
}
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
myMenu = menu!!
return super.onPrepareOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
when (item.itemId) {
R.id.action_settings -> {
val intent = Intent(this, SettingsActivity::class.java)
startActivity(intent)
return true
}
R.id.action_login -> {
val intent = Intent(this, LoginActivity::class.java)
startActivity(intent)
return true
}
R.id.action_logout -> {
logout()
return true
}
else -> return super.onOptionsItemSelected(item)
}
}
override fun onNavigationItemSelected(item: MenuItem): Boolean {
// Handle navigation view item clicks here.
// if(::lastItem.isInitialized){
// lastItem.isChecked = false
// }
lastItem = item
// item.isChecked = true
when (item.itemId) {
R.id.nav_popular-> {
getPopularVideos()
}
R.id.nav_recent-> {
getLastVideos()
}
R.id.nav_local-> {
getLocalVideos()
}
R.id.nav_about-> {
val intent = Intent(this, AboutActivity::class.java)
startActivity(intent)
}
}
drawer_layout.closeDrawer(GravityCompat.START)
return true
}
override fun onResume() {
super.onResume()
ManagerSingleton.context = this
setSideData()
}
private fun setSideData(){
if(ManagerSingleton.user.status == 1){
side_usernameTxt?.text = ManagerSingleton.user.username
side_emailTxt?.text = ManagerSingleton.user.email
if(ManagerSingleton.user.avatar!="" && side_imageView != null)
Picasso.get().load("https://"+ManagerSingleton.url+ManagerSingleton.user.avatar).into(side_imageView)
side_imageView?.setOnClickListener {
getMyVideos()
drawer_layout.closeDrawer(GravityCompat.START)
}
if(::myMenu.isInitialized){
myMenu.findItem(R.id.action_login).isVisible = false
myMenu.findItem(R.id.action_logout).isVisible = true
}
}
}
fun logout(){
if(::myMenu.isInitialized){
myMenu.findItem(R.id.action_login).isVisible = true
myMenu.findItem(R.id.action_logout).isVisible = false
}
side_usernameTxt?.text = getString(R.string.nav_header_title)
side_emailTxt?.text = getString(R.string.nav_header_subtitle)
side_imageView?.setImageResource(R.mipmap.ic_launcher_round)
side_imageView?.setOnClickListener { }
_db.logout()
ManagerSingleton.logout()
this.refresh()
ManagerSingleton.Toast(getString(R.string.logout_msg))
}
}

View File

@ -0,0 +1,23 @@
package org.libre.agosto.p2play
import android.content.Context
import org.libre.agosto.p2play.models.TokenModel
import org.libre.agosto.p2play.models.UserModel
object ManagerSingleton {
var context: Context?= null
var url: String?= null
var user: UserModel = UserModel()
var token: TokenModel = TokenModel()
// var keys:
fun Toast(text: String?) {
if(this.context == null) { return }
android.widget.Toast.makeText(this.context, text, android.widget.Toast.LENGTH_SHORT).show()
}
fun logout(){
user = UserModel()
token = TokenModel()
}
}

View File

@ -0,0 +1,56 @@
package org.libre.agosto.p2play
import android.content.SharedPreferences
import android.os.AsyncTask
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.os.Looper
import android.preference.PreferenceManager
import android.util.Log
import kotlinx.android.synthetic.main.activity_register.*
import org.libre.agosto.p2play.ajax.Auth
class RegisterActivity : AppCompatActivity() {
private val _auth = Auth()
lateinit var settings: SharedPreferences
lateinit var client_id: String
lateinit var client_secret: String
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_register)
setTitle(R.string.registerActionBtn)
ManagerSingleton.context = this
settings = PreferenceManager.getDefaultSharedPreferences(this)
client_id = settings.getString("client_id", "")
client_secret = settings.getString("client_secret", "")
registerBtn.setOnClickListener { registerUser() }
}
fun registerUser(){
registerBtn.isEnabled = false
val username = userText2.text.toString()
val password = passwordText2.text.toString()
val email = emailText.text.toString()
AsyncTask.execute {
if (Looper.myLooper()==null)
Looper.prepare()
val res = _auth.register(username, password, email)
Log.d("Res register", res.toString())
runOnUiThread {
when (res) {
1 -> {
ManagerSingleton.Toast(getString(R.string.registerSuccess_msg))
finish()
}
0 -> ManagerSingleton.Toast(getString(R.string.registerFailed_msg))
-1 -> ManagerSingleton.Toast(getString(R.string.registerError_msg))
}
registerBtn.isEnabled = true
}
}
}
}

View File

@ -0,0 +1,39 @@
package org.libre.agosto.p2play
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.activity_reproductor.*
import org.libre.agosto.p2play.models.VideoModel
class ReproductorActivity : AppCompatActivity() {
lateinit var video:VideoModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reproductor)
ManagerSingleton.context = this
videoView.settings.javaScriptEnabled = true
videoView.settings.allowContentAccess = true
try {
this.video = this.intent.extras.getSerializable("video") as VideoModel
tittleVideoTxt.text = this.video.name
viewsTxt.text = this.video.views.toString() + ' ' + getString(R.string.view_text)
userTxt.text = this.video.username
descriptionVideoTxt.text = this.video.description
if(this.video.userImageUrl!="")
Picasso.get().load("https://"+ManagerSingleton.url+this.video.userImageUrl).into(userImg)
videoView.loadUrl("https://"+ManagerSingleton.url+this.video.embedUrl)
Log.d("url", videoView.url)
}
catch (err:Exception){
err.printStackTrace()
Log.d("Error", err?.message)
}
subscribeBtn.setOnClickListener { ManagerSingleton.Toast(getString(R.string.comming)) }
}
}

View File

@ -0,0 +1,162 @@
package org.libre.agosto.p2play
import android.annotation.TargetApi
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.media.RingtoneManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.preference.ListPreference
import android.preference.Preference
import android.preference.PreferenceActivity
import android.preference.PreferenceFragment
import android.preference.PreferenceManager
import android.preference.RingtonePreference
import android.text.TextUtils
import android.util.Log
import android.view.MenuItem
/**
* A [PreferenceActivity] that presents a set of application settings. On
* handset devices, settings are presented as a single list. On tablets,
* settings are split by category, with category headers shown to the left of
* the list of settings.
*
* See [Android Design: Settings](http://developer.android.com/design/patterns/settings.html)
* for design guidelines and the [Settings API Guide](http://developer.android.com/guide/topics/ui/settings.html)
* for more information on developing a Settings UI.
*/
class SettingsActivity : AppCompatPreferenceActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ManagerSingleton.context = this
setupActionBar()
}
override fun onBackPressed() {
super.onBackPressed()
ManagerSingleton.Toast(getString(R.string.pref_message_exit))
}
/**
* Set up the [android.app.ActionBar], if the API is available.
*/
private fun setupActionBar() {
supportActionBar?.setDisplayHomeAsUpEnabled(false)
}
/**
* {@inheritDoc}
*/
override fun onIsMultiPane(): Boolean {
return isXLargeTablet(this)
}
/**
* {@inheritDoc}
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
override fun onBuildHeaders(target: List<PreferenceActivity.Header>) {
loadHeadersFromResource(R.xml.pref_headers, target)
}
/**
* This method stops fragment injection in malicious applications.
* Make sure to deny any unknown fragments here.
*/
override fun isValidFragment(fragmentName: String): Boolean {
return PreferenceFragment::class.java.name == fragmentName
|| GeneralPreferenceFragment::class.java.name == fragmentName
}
/**
* This fragment shows general preferences only. It is used when the
* activity is showing a two-pane settings UI.
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
class GeneralPreferenceFragment : PreferenceFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
addPreferencesFromResource(R.xml.pref_general)
setHasOptionsMenu(true)
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
// to their values. When their values change, their summaries are
// updated to reflect the new value, per the Android Design
// guidelines.
bindPreferenceSummaryToValue(findPreference("hostP2play"))
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
val id = item.itemId
if (id == android.R.id.home) {
startActivity(Intent(activity, SettingsActivity::class.java))
return true
}
return super.onOptionsItemSelected(item)
}
}
companion object {
/**
* A preference value change listener that updates the preference's summary
* to reflect its new value.
*/
private val sBindPreferenceSummaryToValueListener = Preference.OnPreferenceChangeListener { preference, value ->
val stringValue = value.toString()
if (preference is ListPreference) {
// For list preferences, look up the correct display value in
// the preference's 'entries' list.
val listPreference = preference
val index = listPreference.findIndexOfValue(stringValue)
// Set the summary to reflect the new value.
preference.setSummary(
if (index >= 0)
listPreference.entries[index]
else
null)
} else {
// For all other preferences, set the summary to the value's
// simple string representation.
preference.summary = stringValue
}
true
}
/**
* Helper method to determine if the device has an extra-large screen. For
* example, 10" tablets are extra-large.
*/
private fun isXLargeTablet(context: Context): Boolean {
return context.resources.configuration.screenLayout and Configuration.SCREENLAYOUT_SIZE_MASK >= Configuration.SCREENLAYOUT_SIZE_XLARGE
}
/**
* Binds a preference's summary to its value. More specifically, when the
* preference's value is changed, its summary (line of text below the
* preference title) is updated to reflect the value. The summary is also
* immediately updated upon calling this method. The exact display format is
* dependent on the type of preference.
* @see .sBindPreferenceSummaryToValueListener
*/
private fun bindPreferenceSummaryToValue(preference: Preference) {
// Set the listener to watch for value changes.
preference.onPreferenceChangeListener = sBindPreferenceSummaryToValueListener
// Trigger the listener immediately with the preference's
// current value.
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
PreferenceManager
.getDefaultSharedPreferences(preference.context)
.getString(preference.key, ""))
}
}
}

View File

@ -0,0 +1,79 @@
package org.libre.agosto.p2play.adapters
import android.app.Activity
import android.content.Intent
import android.graphics.drawable.Drawable
import android.os.AsyncTask
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.squareup.picasso.Picasso
import org.libre.agosto.p2play.MainActivity
import org.libre.agosto.p2play.ManagerSingleton
import org.libre.agosto.p2play.R
import org.libre.agosto.p2play.ReproductorActivity
import org.libre.agosto.p2play.models.VideoModel
import java.io.InputStream
import java.io.Serializable
import java.net.URL
class VideosAdapter(private val myDataset: ArrayList<VideoModel>) :
RecyclerView.Adapter<VideosAdapter.ViewHolder>() {
// Provide a reference to the views for each data item
// Complex data items may need more than one view per item, and
// you provide access to all the views for a data item in a view holder.
// Each data item is just a string in this case that is shown in a TextView.
class ViewHolder(val view: View) : RecyclerView.ViewHolder(view){
val thumb: ImageView
val userImg: ImageView
val tittle: TextView
val description: TextView
init {
// Define click listener for the ViewHolder's View
tittle = view.findViewById(R.id.tittleTxt)
description = view.findViewById(R.id.descriptionTxt)
thumb = view.findViewById(R.id.thumb)
userImg = view.findViewById(R.id.userImg)
}
}
// Create new views (invoked by the layout manager)
override fun onCreateViewHolder(parent: ViewGroup,
viewType: Int): VideosAdapter.ViewHolder {
// create a new view
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.view_video, parent, false) as View
// set the view's size, margins, paddings and layout parameters
return ViewHolder(view)
}
// Replace the contents of a view (invoked by the layout manager)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
// - get element from your dataset at this position
// - replace the contents of the view with that element
holder.tittle.text = myDataset[position].name
Picasso.get().load("https://"+ManagerSingleton.url+myDataset[position].thumbUrl).into(holder.thumb)
holder.thumb.setOnClickListener {
val intent = Intent(ManagerSingleton.context, ReproductorActivity::class.java)
intent.putExtra("video", myDataset[position] as Serializable)
ManagerSingleton.context!!.startActivity(intent)
}
if(myDataset[position].userImageUrl!="")
Picasso.get().load("https://"+ManagerSingleton.url+myDataset[position].userImageUrl).into(holder.userImg);
val viewsText = ManagerSingleton.context!!.getString(R.string.view_text)
val timeText = ManagerSingleton.context!!.getString(R.string.time_text)
holder.description.text = myDataset[position].username+" - "+myDataset[position].views+" "+viewsText+" - "+myDataset[position].duration+" "+timeText
}
// Return the size of your dataset (invoked by the layout manager)
override fun getItemCount() = myDataset.size
}

View File

@ -0,0 +1,171 @@
package org.libre.agosto.p2play.ajax
import android.support.design.widget.Snackbar
import android.util.JsonReader
import android.util.Log
import org.libre.agosto.p2play.ManagerSingleton
import org.libre.agosto.p2play.models.TokenModel
import org.libre.agosto.p2play.models.UserModel
import java.io.InputStreamReader
class Auth: Client() {
val stockParams = "grant_type=password"
fun login(username: String, password: String, client_id: String, client_secret: String): TokenModel{
var con = this._newCon("users/token","POST")
val params:String= "$stockParams&username=$username&password=$password&client_id=$client_id&client_secret=$client_secret"
con.outputStream.write(params.toByteArray())
var token = TokenModel()
try {
if(con.responseCode==200){
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
data.beginObject()
while(data.hasNext()){
val k = data.nextName()
when(k.toString()){
"access_token" -> token.token = data.nextString()
"refresh_token" -> token.refresh_token = data.nextString()
else -> data.skipValue()
}
}
data.endObject()
token.status = 1
}
else{
Log.d("Status", con.responseMessage)
}
}
catch (err: Exception){
err.printStackTrace()
token.status = 0
}
return token
}
fun register(username: String, password: String, email: String): Int{
var con = this._newCon("users/register","POST")
val params:String= "username=$username&password=$password&email=$email"
con.outputStream.write(params.toByteArray())
var response = 0
try {
if (con.responseCode == 204) {
response = 1
}
}
catch (err: Exception){
err.printStackTrace()
response = -1
}
return response
}
fun refreshToken(token: TokenModel, client_id: String, client_secret: String): TokenModel{
var con = this._newCon("users/token", "POST", token.token)
val params:String = "refresh_token=${token.refresh_token}&response_type=code&grant_type=refresh_token&client_id=$client_id&client_secret=$client_secret"
con.outputStream.write(params.toByteArray())
var token = TokenModel()
try {
if(con.responseCode==200){
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
data.beginObject()
while(data.hasNext()){
val k = data.nextName()
when(k.toString()){
"access_token" -> token.token = data.nextString()
"refresh_token" -> token.refresh_token = data.nextString()
else -> data.skipValue()
}
}
data.endObject()
token.status = 1
}
else{
Log.d("Status", con.responseMessage)
}
}
catch (err: Exception){
err.printStackTrace()
token.status = 0
}
return token
}
fun me(token: String): UserModel{
var con = this._newCon("users/me","GET", token)
var user = UserModel()
try {
if(con.responseCode==200){
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
data.beginObject()
while(data.hasNext()){
val k = data.nextName()
when(k.toString()){
"id" -> user.uuid = data.nextInt()
"username" -> user.username = data.nextString()
"email" -> user.email = data.nextString()
"displayNSFW" -> user.nsfw = data.nextBoolean()
"account" -> {
data.beginObject()
while (data.hasNext()){
val l = data.nextName()
when(l.toString()){
"followersCount" -> user.followers = data.nextInt()
"avatar" -> {
data.beginObject()
while (data.hasNext()){
val m = data.nextName()
when (m.toString()){
"path" -> user.avatar = data.nextString()
else -> data.skipValue()
}
}
data.endObject()
}
else -> data.skipValue()
}
}
data.endObject()
}
else -> data.skipValue()
}
}
data.endObject()
user.status = 1
}
else{
Log.d("Status", con.responseMessage)
}
}
catch (err: Exception){
err.printStackTrace()
user.status = 0
}
return user
}
}

View File

@ -0,0 +1,70 @@
package org.libre.agosto.p2play.ajax
import android.content.SharedPreferences
import android.util.JsonReader
import android.util.Log
import org.libre.agosto.p2play.ManagerSingleton
import org.libre.agosto.p2play.models.HostModel
import java.io.InputStreamReader
import java.net.HttpURLConnection
import java.net.URL
open class Client {
protected fun _newCon(uri: String, method: String, token: String = ""): HttpURLConnection {
var url = URL("https://"+ManagerSingleton.url+"/api/v1/"+uri)
var con = url.openConnection() as HttpURLConnection
con.setRequestProperty("User-Agent", "P2play/0.1")
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded")
con.setRequestProperty("Accept", "*/*")
if(token != ""){
con.setRequestProperty("Authorization", "Bearer ${token}")
}
con.requestMethod=method
con.connectTimeout=10000
con.readTimeout=10000
if(method.equals("POST"))
con.doOutput=true
Log.d("Petition", url.toString())
return con
}
fun getKeys():HostModel{
var con=this._newCon("oauth-clients/local","GET")
var keys = HostModel("","")
try {
if (con.responseCode == 200) {
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
data.beginObject()
while (data.hasNext()) {
val key = data.nextName()
when (key.toString()) {
"client_id"->{
keys.client_id = data.nextString()
}
"client_secret"->{
keys.client_secret = data.nextString()
}
else->{
data.skipValue()
}
}
}
}
Log.d("Key",keys.client_id)
return keys
} catch(err:Exception){
Log.d("Error",err.message)
return keys
}
}
}

View File

@ -0,0 +1,136 @@
package org.libre.agosto.p2play.ajax
import android.util.JsonReader
import android.util.JsonToken
import android.util.Log
import org.libre.agosto.p2play.models.VideoModel
import java.io.InputStreamReader
class Videos: Client() {
fun parseVideos(data: JsonReader): ArrayList<VideoModel>{
var videos = arrayListOf<VideoModel>()
data.beginObject()
while (data.hasNext()){
when(data.nextName()){
"data"->{
data.beginArray()
while (data.hasNext()) {
val video = VideoModel()
data.beginObject()
while (data.hasNext()){
val key = data.nextName()
when (key.toString()) {
"name"->{
video.name= data.nextString()
}
"description"->{
if(data.peek() == JsonToken.STRING)
video.description = data.nextString()
else
data.skipValue()
}
"duration"->{
video.duration = data.nextInt()
}
"thumbnailPath"->{
video.thumbUrl = data.nextString()
}
"embedPath"->{
video.embedUrl = data.nextString()
}
"views"->{
video.views = data.nextInt()
}
"account"->{
data.beginObject()
while (data.hasNext()){
val acKey = data.nextName()
when(acKey.toString()){
"name"->video.username=data.nextString()
"avatar"->{
if(data.peek() == JsonToken.BEGIN_OBJECT){
data.beginObject()
while (data.hasNext()){
val avKey = data.nextName()
when(avKey){
"path"-> video.userImageUrl = data.nextString()
else-> data.skipValue()
}
}
data.endObject()
}
else
data.skipValue()
}
else-> data.skipValue()
}
}
data.endObject()
}
else->{
data.skipValue()
}
}
}
data.endObject()
videos.add(video)
}
data.endArray()
}
else-> data.skipValue()
}
}
data.endObject()
return videos
}
private fun getVideos(start:Int, count:Int, sort:String = "-publishedAt", filter:String = ""):ArrayList<VideoModel>{
val params = "start=$start&count=$count&sort=$sort&filter=$filter"
var con=this._newCon("videos?$params","GET")
var videos = arrayListOf<VideoModel>()
try {
if (con.responseCode == 200) {
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
videos = parseVideos(data)
}
} catch(err:Exception){
err?.printStackTrace()
Log.d("TypeErr",err?.message ,err.cause)
Log.d("Error","fallo la coneccion")
}
return videos
}
fun getLastVideos(start:Int = 0, count:Int = 30): ArrayList<VideoModel>{
return this.getVideos(start, count)
}
fun getPopularVideos(start:Int = 0, count:Int = 30): ArrayList<VideoModel>{
return this.getVideos(start, count,"-views")
}
fun getLocalVideos(start:Int = 0, count:Int = 30): ArrayList<VideoModel>{
return this.getVideos(start, count,"-publishedAt", "local")
}
fun myVideos(token: String): ArrayList<VideoModel>{
var con=this._newCon("users/me/videos","GET", token)
var videos = arrayListOf<VideoModel>()
try {
if (con.responseCode == 200) {
var response = InputStreamReader(con.inputStream)
var data = JsonReader(response)
videos = parseVideos(data)
}
} catch(err:Exception){
err?.printStackTrace()
Log.d("TypeErr",err?.message ,err.cause)
Log.d("Error","fallo la coneccion")
}
return videos
}
}

View File

@ -0,0 +1,3 @@
package org.libre.agosto.p2play.models
class HostModel (var client_id:String, var client_secret:String)

View File

@ -0,0 +1,7 @@
package org.libre.agosto.p2play.models
class TokenModel (
var token: String = "",
var refresh_token: String = "",
var status: Int = -1
)

View File

@ -0,0 +1,12 @@
package org.libre.agosto.p2play.models
class UserModel (
var id: Int = 0,
var uuid: Int = 0,
var username: String = "",
var email: String = "",
var nsfw: Boolean = true,
var followers: Int = 0,
var avatar: String = "",
var status: Int = -1
)

View File

@ -0,0 +1,14 @@
package org.libre.agosto.p2play.models
import java.io.Serializable
class VideoModel(
var name:String="",
var description:String="",
var thumbUrl:String="",
var userImageUrl:String="",
var embedUrl:String="",
var duration:Number=0,
var username:String="",
var views:Number=0
):Serializable

BIN
app/src/main/res/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

BIN
app/src/main/res/drawable/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" />
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11.5,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zm6.5,-6v-5.5c0,-3.07 -2.13,-5.64 -5,-6.32V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5v0.68c-2.87,0.68 -5,3.25 -5,6.32V16l-2,2v1h17v-1l-2,-2z" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-.25 1.97,-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01.25,-1.97.7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear" />
</shape>

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AboutActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Logo"
app:srcCompat="@drawable/icon" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/aboutLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutLabel"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse"
android:textColor="@android:color/black"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/aboutText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutText"
android:textAlignment="textStart"
android:textSize="16sp" />
<TextView
android:id="@+id/gitlabUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/aboutGitUrl"
android:textAlignment="center"
android:textSize="16sp"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<TextView
android:id="@+id/aboutLabel2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutStatus"
android:textAppearance="@android:style/TextAppearance.Material.Small" />
<TextView
android:id="@+id/gnuUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/aboutGnuUrl"
android:textAlignment="center"
android:textSize="16sp"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/aboutLabel3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutInstance"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse"
android:textColor="@android:color/black"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<TextView
android:id="@+id/aboutText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutInWeb"
android:textAlignment="textStart"
android:textSize="16sp" />
<TextView
android:id="@+id/aboutUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:linksClickable="true"
android:textAlignment="center"
android:textSize="16sp"
android:textStyle="bold" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/aboutText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/aboutLicense"
android:textAlignment="textStart"
android:textSize="16sp" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HostActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Logo"
app:srcCompat="@drawable/icon" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/hostInfoText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hostInfoText"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse"
android:textColor="@android:color/black" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<EditText
android:id="@+id/hostText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/hostText"
android:inputType="text" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/okButton" />
</LinearLayout>
</FrameLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LoginActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Logo"
app:srcCompat="@drawable/icon" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/loginInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/loginInfo"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse"
android:textColor="@android:color/black" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/userTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/userTxt" />
<EditText
android:id="@+id/userText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/userText"
android:inputType="text" />
<TextView
android:id="@+id/passwordTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/passwordTxt" />
<EditText
android:id="@+id/passwordText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/passwordText"
android:inputType="text|textPassword" />
<Button
android:id="@+id/loginBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/loginBtn"
android:textAlignment="center" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<Button
android:id="@+id/registerActionBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/registerActionBtn"
android:visibility="visible" />
</LinearLayout>
</FrameLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegisterActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Logo"
app:srcCompat="@drawable/icon" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/registerInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/loginInfo"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Medium.Inverse"
android:textColor="@android:color/black" />
<Space
android:layout_width="match_parent"
android:layout_height="30dp" />
<TextView
android:id="@+id/userTxt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/userTxt" />
<EditText
android:id="@+id/userText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/userText"
android:inputType="text" />
<TextView
android:id="@+id/emailTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/emailTxt" />
<EditText
android:id="@+id/emailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/emailText"
android:inputType="text" />
<TextView
android:id="@+id/passwordTxt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/passwordTxt" />
<EditText
android:id="@+id/passwordText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/passwordText"
android:inputType="text|textPassword" />
<Button
android:id="@+id/registerBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/registerBtn"
android:textAlignment="center" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ReproductorActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<WebView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="220dp">
</WebView>
<TextView
android:id="@+id/tittleVideoTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textStyle="bold" />
<TextView
android:id="@+id/viewsTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone">
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/likeBtn" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dislikeBtn" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/shareBtn" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/reportBtn" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/userImg"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:adjustViewBounds="false"
android:cropToPadding="false"
android:padding="5dp"
android:scaleType="centerInside"
app:srcCompat="@drawable/default_avatar" />
<TextView
android:id="@+id/userTxt"
android:layout_width="70dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textColor="@android:color/black" />
<Button
android:id="@+id/subscribeBtn"
style="@android:style/Widget.Holo.Button.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/subscribeBtn"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="@+id/descriptionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="@string/descriptionTxt" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="80dp">
<TextView
android:id="@+id/descriptionVideoTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLength="1000"
android:maxLines="1000"
android:paddingLeft="5dp"
android:text="TextView"
android:textStyle="italic" />
</ScrollView>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/P2playTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/P2playTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/app_bar_main">
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:touchscreenBlocksFocus="false"
android:visibility="visible"
app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@android:color/darker_gray"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/side_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:id="@+id/side_usernameTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/side_emailTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle" />
</LinearLayout>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/thumb"
android:layout_width="match_parent"
android:layout_height="230dp"
app:srcCompat="@android:drawable/ic_menu_gallery" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="63dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/userImg"
android:layout_width="140dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:adjustViewBounds="false"
android:clickable="false"
android:cropToPadding="false"
android:padding="5dp"
android:scaleType="centerInside"
app:srcCompat="@drawable/default_avatar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tittleTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLength="70"
android:text="TextView"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/descriptionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="15dp"
android:layout_weight="1"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<item android:title="Videos">
<menu>
<item
android:id="@+id/nav_popular"
android:icon="@android:drawable/btn_star"
android:title="@string/nav_popular" />
<item
android:id="@+id/nav_recent"
android:icon="@drawable/ic_add_circle_black_24dp"
android:title="@string/nav_recent" />
<item
android:id="@+id/nav_local"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/nav_local" />
</menu>
</item>
<item android:title="More">
<menu>
<item
android:id="@+id/nav_about"
android:icon="@android:drawable/ic_dialog_info"
android:title="@string/nav_about" />
</menu>
</item>
</menu>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_login"
android:title="@string/action_login"
app:showAsAction="never" />
<item
android:id="@+id/action_logout"
android:title="@string/action_logout"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>

View File

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

View File

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

BIN
app/src/main/res/mipmap-hdpi/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
app/src/main/res/mipmap-mdpi/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
app/src/main/res/mipmap-xhdpi/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
app/src/main/res/mipmap-xxhdpi/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="aboutLabel">Sobre P2Play</string>
<string name="aboutText">P2Play es una aplicacion no-oficial de PeerTube. Tu puedes ver y cntribuir con el codigo en GitLab:</string>
<string name="aboutStatus">Puedes subscribirte a nuestro perfil en GNU Social:</string>
<string name="aboutLicense">Copyleft GNU GPLv3 License</string>
<string name="aboutInstance">Sobre la instancia</string>
<string name="aboutInWeb">Para ver los terminos y mas visita la web:</string>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hostInfoText">Selecciona la instancia que prefieras</string>
<string name="okButton">Aceptar</string>
</resources>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loginInfo">Acceder o crear una cuenta nueva</string>
<string name="userTxt">Usuario:</string>
<string name="userText"></string>
<string name="passwordTxt">Contraseña:</string>
<string name="passwordText"></string>
<string name="loginBtn">Ingresar</string>
<string name="registerActionBtn">Crear una cuenta</string>
<string name="emailTxt">Correo:</string>
<string name="emailText">user@mail.com</string>
<string name="registerBtn">Registrar ahora</string>
<!-- Toast msg -->
<string name="loginSuccess_msg">Te has identificado</string>
<string name="loginError_msg">Ha ocurrido un error</string>
<string name="loginFailed_msg">Credenciales invalidas</string>
</resources>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="title_recent">Recientes</string>
<string name="title_popular">Populares</string>
<string name="title_local">Locales</string>
<string name="title_myVideos">Mis videos</string>
<string name="view_text">vistas</string>
<string name="time_text">segundos</string>
<string name="nav_header_title">Inicia session</string>
<string name="nav_header_subtitle">P2Play (alfa)</string>
<!-- Toast msg -->
<string name="logout_msg">Te has desconectado</string>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nav_popular">Populares</string>
<string name="nav_recent">Recientes</string>
<string name="nav_local">Local</string>
<string name="nav_about">Sobre</string>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="action_settings">Configuracion</string>
<string name="action_login">Acceder</string>
<string name="action_logout">Cerrar sesion</string>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="descriptionTxt">Descripcion:</string>
<string name="likeBtn">Like</string>
<string name="dislikeBtn">Dislike</string>
<string name="shareBtn">Compartir</string>
<string name="reportBtn">Reportar</string>
<string name="subscribeBtn">Subscribir</string>
</resources>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="title_activity_settings">Configuracion</string>
<!-- Strings related to Settings -->
<!-- Example General settings -->
<string name="pref_header_general">General</string>
<string name="pref_nfsw_title">Contenido NFSW</string>
<string name="pref_nfsw_description">Si es activado podria mostrar contenido para adultos o sencible.</string>
<string name="pref_hostname_title">Instancia Peertube</string>
<string name="pref_hostname_error">-</string>
<string name="pref_message_exit">Reinicia para aplicar los cambios</string>
</resources>

View File

@ -0,0 +1,9 @@
<resources>
<style name="P2playTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:textColor">@color/colorBlack</item>
</style>
</resources>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="aboutGitUrl">https://gitlab.com/agosto182/p2play/</string>
<string name="aboutGnuUrl">https://gnusocial.ml/p2play</string>
<string name="aboutLabel">About P2Play</string>
<string name="aboutText">P2Play is an Android application unnoficial of PeerTube. You can watch and contribute with the code on GitLab:</string>
<string name="aboutStatus">You can subscribe to our profile on GNU Social:</string>
<string name="aboutLicense">Copyleft GNU GPLv3 License</string>
<string name="aboutInstance">About instance</string>
<string name="aboutInWeb">You can see terms and more on the web:</string>
</resources>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorHeader">#ffffff</color>
<color name="colorBody">#fff</color>
<color name="colorMenu">#000</color>
<color name="colorBlack">#000</color>
</resources>

View File

@ -0,0 +1,8 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hostInfoText">Selecciona la instancia que prefieras</string>
<string name="okButton">Aceptar</string>
<string name="errorMsg">Error, try again</string>
<string name="finallyMsg">Host saved</string>
</resources>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loginInfo">Login or register new account</string>
<string name="userTxt">Username:</string>
<string name="userText"></string>
<string name="passwordTxt">Password:</string>
<string name="passwordText"></string>
<string name="loginBtn">Login now</string>
<string name="registerActionBtn">Create new account</string>
<!-- Toast msg -->
<string name="loginSuccess_msg">You are logged</string>
<string name="loginError_msg">An error has ocurred</string>
<string name="loginFailed_msg">Invalid credentials</string>
<string name="registerSuccess_msg">You are registered</string>
<string name="registerError_msg">An error has ocurred</string>
<string name="registerFailed_msg">Invalid data</string>
<!-- Register msg -->
<string name="registerBtn">Register now</string>
<string name="emailTxt">Email:</string>
<string name="emailText">user@mail.com</string>
</resources>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="title_recent">Recent videos</string>
<string name="title_popular">Popular videos</string>
<string name="title_local">Local videos</string>
<string name="title_myVideos">My videos</string>
<string name="view_text">views</string>
<string name="time_text">seconds</string>
<string name="nav_header_title">Log In</string>
<string name="nav_header_subtitle">P2Play (alpha)</string>
<!-- Toast msg -->
<string name="logout_msg">You are disconnected</string>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nav_popular">Popular</string>
<string name="nav_recent">Recent</string>
<string name="nav_local">Local</string>
<string name="nav_about">About</string>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="action_settings">Settings</string>
<string name="action_login">Log In</string>
<string name="action_logout">Logout</string>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="descriptionTxt">Description:</string>
<string name="likeBtn">Like</string>
<string name="dislikeBtn">Dislike</string>
<string name="shareBtn">Share</string>
<string name="reportBtn">Report</string>
<string name="subscribeBtn">Subscribe</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More