Skip to content

Commit e0b7173

Browse files
committed
Renamed module. Refactoring
1 parent bdac8d2 commit e0b7173

File tree

158 files changed

+3689
-3485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+3689
-3485
lines changed

app/build.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ apply plugin: 'kotlin-android'
55
apply plugin: 'kotlin-android-extensions'
66

77
android {
8-
compileSdkVersion 30
9-
buildToolsVersion "30.0.2"
8+
compileSdkVersion 31
9+
buildToolsVersion "30.0.3"
1010
defaultConfig {
1111
applicationId "com.gapps.videonoapi"
1212
minSdkVersion 19
13-
targetSdkVersion 30
13+
targetSdkVersion 31
1414
versionCode 1
1515
versionName "1.0"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -26,18 +26,16 @@ android {
2626

2727
dependencies {
2828
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
30-
implementation 'androidx.appcompat:appcompat:1.2.0'
31-
implementation 'androidx.core:core-ktx:1.3.2'
29+
implementation 'androidx.appcompat:appcompat:1.4.1'
30+
implementation 'androidx.core:core-ktx:1.7.0'
3231

33-
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
34-
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
32+
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
33+
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
3534

3635
//Gson
37-
implementation 'com.google.code.gson:gson:2.8.6'
38-
implementation(project(':library'))
36+
implementation(project(':embedded_video_lib'))
3937

40-
implementation 'androidx.recyclerview:recyclerview:1.1.0'
38+
implementation 'androidx.recyclerview:recyclerview:1.2.1'
4139
implementation 'com.squareup.picasso:picasso:2.71828'
4240
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
4341
}

app/src/androidTest/java/com/gapps/videonoapi/ExampleInstrumentedTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import org.junit.Assert.*
1515
*/
1616
@RunWith(AndroidJUnit4::class)
1717
class ExampleInstrumentedTest {
18-
@Test
19-
fun useAppContext() {
20-
// Context of the app under test.
21-
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22-
assertEquals("com.gapps.videonoapi", appContext.packageName)
23-
}
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.gapps.videonoapi", appContext.packageName)
23+
}
2424
}

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.gapps.videonoapi">
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.gapps.videonoapi">
55

6-
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.INTERNET" />
77

8-
<application
9-
android:allowBackup="true"
10-
android:icon="@mipmap/ic_launcher"
11-
android:label="@string/app_name"
12-
android:roundIcon="@mipmap/ic_launcher_round"
13-
android:supportsRtl="true"
14-
android:theme="@style/AppTheme"
15-
android:usesCleartextTraffic="true"
16-
tools:targetApi="m">
17-
<activity
18-
android:name=".ui.main.MainActivity"
19-
android:label="@string/app_name"
20-
android:theme="@style/AppTheme.NoActionBar">
21-
<intent-filter>
22-
<action android:name="android.intent.action.MAIN" />
8+
<application
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/AppTheme"
15+
android:usesCleartextTraffic="true"
16+
tools:targetApi="m">
17+
<activity
18+
android:name=".ui.main.MainActivity"
19+
android:exported="true"
20+
android:label="@string/app_name"
21+
android:theme="@style/AppTheme.NoActionBar">
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN" />
2324

24-
<category android:name="android.intent.category.LAUNCHER" />
25-
</intent-filter>
26-
</activity>
27-
<activity
28-
android:name=".ui.text.TextActivity"
29-
android:label="@string/app_name"
30-
android:theme="@style/AppTheme.NoActionBar">
31-
</activity>
32-
</application>
25+
<category android:name="android.intent.category.LAUNCHER" />
26+
</intent-filter>
27+
</activity>
28+
<activity
29+
android:name=".ui.text.TextActivity"
30+
android:label="@string/app_name"
31+
android:theme="@style/AppTheme.NoActionBar" />
32+
</application>
3333

3434
</manifest>

app/src/main/java/com/gapps/videonoapi/ui/base/BaseActivity.kt

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,58 @@ import com.gapps.videonoapi.R
1111

1212
abstract class BaseActivity : AppCompatActivity() {
1313

14-
protected fun showVideo(model: VideoPreviewModel) {
15-
val host = model.videoHosting
16-
val linkToPlay = model.linkToPlay
17-
val title = model.videoTitle
18-
val initUrl = model.url
14+
protected fun showVideo(model: VideoPreviewModel) {
15+
val host = model.videoHosting
16+
val linkToPlay = model.linkToPlay
17+
val title = model.videoTitle
18+
val initUrl = model.url
1919

20-
BottomVideoController.build(this) {
21-
setListener(object : BottomVideoController.Listener() {
22-
override fun openLinkIn(link: String) {
23-
openLink(link)
24-
}
20+
BottomVideoController.build(this) {
21+
setListener(object : BottomVideoController.Listener() {
22+
override fun openLinkIn(link: String) {
23+
openLink(link)
24+
}
2525

26-
override fun copyLink(link: String) {
27-
copyLinkToClipboard(link)
28-
}
29-
})
30-
setHostText(host)
31-
setPlayLink(linkToPlay)
32-
setSize(model.width, model.height)
33-
setTitle(title)
34-
setVideoUrl(initUrl)
35-
setBackgroundColor(R.color.colorBackground)
36-
setTextColor(R.color.colorHostName)
37-
setTitleColor(R.color.colorVideoTitle)
38-
setLeftButtonText(R.string.vna_close)
39-
setRightButtonText(R.string.vna_open_in)
40-
setRightButtonTextColor(R.color.colorVideoTitle)
41-
setLeftButtonTextColor(R.color.colorVideoTitle)
42-
setCenterButtonIcon(R.drawable.ic_vna_content_copy)
43-
setCenterButtonIconTint(R.color.colorVideoTitle)
44-
setProgressView(TextView(this@BaseActivity).apply { text = "Loading"; setTextColor(-1) })
45-
show()
46-
}
47-
}
26+
override fun copyLink(link: String) {
27+
copyLinkToClipboard(link)
28+
}
29+
})
30+
setHostText(host)
31+
setPlayLink(linkToPlay)
32+
setSize(model.width, model.height)
33+
setTitle(title)
34+
setVideoUrl(initUrl)
35+
setBackgroundColor(R.color.colorBackground)
36+
setTextColor(R.color.colorHostName)
37+
setTitleColor(R.color.colorVideoTitle)
38+
setLeftButtonText(R.string.vna_close)
39+
setRightButtonText(R.string.vna_open_in)
40+
setRightButtonTextColor(R.color.colorVideoTitle)
41+
setLeftButtonTextColor(R.color.colorVideoTitle)
42+
setCenterButtonIcon(R.drawable.ic_vna_content_copy)
43+
setCenterButtonIconTint(R.color.colorVideoTitle)
44+
setProgressView(TextView(this@BaseActivity).apply {
45+
text = "Loading"; setTextColor(-1)
46+
})
47+
show()
48+
}
49+
}
4850

49-
private fun copyLinkToClipboard(link: String) {
50-
val clip = ClipData.newPlainText("VideoUrl", link)
51-
(getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)?.setPrimaryClip(clip)
52-
Toast.makeText(this, "Copied: $link", Toast.LENGTH_SHORT).show()
53-
}
51+
private fun copyLinkToClipboard(link: String) {
52+
val clip = ClipData.newPlainText("VideoUrl", link)
53+
(getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)?.setPrimaryClip(clip)
54+
Toast.makeText(this, "Copied: $link", Toast.LENGTH_SHORT).show()
55+
}
5456

55-
private fun openLink(link: String) {
56-
try {
57-
val intent = Intent(Intent.ACTION_VIEW).apply {
58-
data = Uri.parse(link)
59-
}
57+
private fun openLink(link: String) {
58+
try {
59+
val intent = Intent(Intent.ACTION_VIEW).apply {
60+
data = Uri.parse(link)
61+
}
6062

61-
startActivity(intent)
62-
} catch (e: ActivityNotFoundException) {
63-
e.printStackTrace()
64-
}
65-
}
63+
startActivity(intent)
64+
} catch (e: ActivityNotFoundException) {
65+
e.printStackTrace()
66+
}
67+
}
6668
}

0 commit comments

Comments
 (0)