Updated Open Source Licenses

This commit is contained in:
Prathamesh More 2021-12-14 23:18:42 +05:30
parent 268e077ab5
commit 4d31c4ccc3
5 changed files with 78 additions and 70 deletions

View file

@ -24,40 +24,48 @@
padding-top: 8px; padding-top: 8px;
} }
</style> </style>
</head> </head>
<body> <body>
<p><b><a href="https://github.com/kabouzeid/Phonograph" title="Phonograph"> Phonograph</a></b> by <p><b><a href="https://github.com/kabouzeid/Phonograph" title="Phonograph"> Phonograph</a></b> by
Karim Abou Zeid</p> Karim Abou Zeid</p>
<p><b><a href="https://github.com/afollestad" title="Material Dialogs"> Material Dialogs and Cab</a></b>
by Aidan Michael Follestad</p>
<p><b><a href="http://developer.android.com/tools/support-library/index.html" <p><b><a href="http://developer.android.com/tools/support-library/index.html"
title="AOSP Support Libraries"> AOSP Support Libraries</a></b>by AOSP contributors</p> title="AOSP Support Libraries">AOSP Support Libraries</a></b> by AOSP contributors</p>
<p><b><a href="https://github.com/bumptech/glide" title="Glide"> Glide</a></b> by Sam Judd</p> <p><b><a href="https://github.com/bumptech/glide" title="Glide"> Glide</a></b> by Sam Judd</p>
<p><b><a href="https://github.com/square/retrofit" title="Retrofit"> Retrofit</a></b> by Square team <p><b><a href="https://github.com/square/retrofit" title="Retrofit"> Retrofit</a></b> by Square team
</p> </p>
<p><b><a href="http://square.github.io/okhttp/" title="OkHttp"> OkHttp</a></b> by Square team</p>
<p><b><a href="https://github.com/InsertKoinIO/koin"
title="Koin">Koin</a></b> by Arnaud Giuliani</p>
<p><b><a href="https://github.com/afollestad" title="Material Dialogs"> Material Dialogs and Cab</a></b>
by Aidan Michael Follestad</p>
<p><b><a href="https://github.com/afollestad/material-cab" title="Material Contextual Action Bar"> <p><b><a href="https://github.com/afollestad/material-cab" title="Material Contextual Action Bar">
Material Contextual Action Bar</a></b> by Aidan Michael Follestad</p> Material Contextual Action Bar</a></b> by Aidan Michael Follestad</p>
<p><b><a href="http://square.github.io/okhttp/" title="OkHttp"> OkHttp</a></b> by Square team</p>
<p><b><a href="https://github.com/hdodenhof/CircleImageView" title="CircleImageView">
CircleImageView</a></b> by Henning Dodenhof</p>
<p><b><a href="https://github.com/DreaminginCodeZH/MaterialProgressBar" title="MaterialProgressBar">
MaterialProgressBar</a></b> by Zhang Hai</p>
<p><b><a href="https://github.com/anjlab/android-inapp-billing-v3" <p><b><a href="https://github.com/anjlab/android-inapp-billing-v3"
title="Android In-App Billing v3 Library"> Android In-App Billing v3 Library</a></b> by title="Android In-App Billing v3 Library"> Android In-App Billing v3 Library</a></b> by
Henning Dodenhof</p> Henning Dodenhof</p>
<p><b><a href="https://github.com/h6ah4i/android-advancedrecyclerview" <p><b><a href="https://github.com/h6ah4i/android-advancedrecyclerview"
title="Advanced RecyclerView"> Advanced RecyclerView</a></b> by Haruki Hasegawa</p> title="Advanced RecyclerView"> Advanced RecyclerView</a></b> by Haruki Hasegawa</p>
<p><b><a href="https://github.com/ksoichiro/Android-ObservableScrollView" <p><b><a href="https://github.com/Ereza/CustomActivityOnCrash"
title="Android-ObservableScrollView"> Android-ObservableScrollView</a></b> by Soichiro title="Custom Activity on Crash">Custom Activity on Crash</a></b> by Eduard Ereza Martínez
Kashima</p> </p>
<p><b><a href="https://github.com/NanoHttpd/nanohttpd"
title="NanoHttpd">NanoHttpd</a></b> by NanoHttpd Team</p>
<p><b><a href="https://github.com/tankery/CircularSeekBar"
title="Circular Seekbar">Circular Seekbar</a></b> by Tankery</p>
<p><b><a href="https://github.com/Kaned1as/jaudiotagger"
title="jAudioTagger">jAudioTagger</a></b> by Kanedias</p>
<p><b><a href="https://github.com/zhanghai/AndroidFastScroll"
title="Android Fast Scroll">Android Fast Scroll</a></b> by Zhang Hai</p>
<p><b><a href="https://github.com/Dhaval2404/ImagePicker"
title="Image Picker">Image Picker</a></b> by Dhaval Patel</p>
<p><b><a href="https://github.com/heinrichreimer/material-intro"
title="Material Intro">Material Intro</a></b> by Jan Heinrich Reimer</p>
<p><b><a href="https://github.com/r0adkll/Slidr"
title="Slidr">Slidr</a></b> by Drew Heavner</p>
<p><b><a href="https://materialdesignicons.com" title="Icons"> Icons</a></b> by Austin Andrews</p> <p><b><a href="https://materialdesignicons.com" title="Icons"> Icons</a></b> by Austin Andrews</p>
<p><b><a href="https://www.techjuice.pk" title="City wallpaper"> Material Design City Wallpaper</a></b> <p><b><a href="https://www.techjuice.pk" title="City wallpaper"> Material Design City Wallpaper</a></b>
</p> </p>
</body> </body>
</html> </html>

View file

@ -16,8 +16,6 @@ package code.name.monkey.retromusic.activities
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.MenuItem import android.view.MenuItem
import android.webkit.WebView
import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark
import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor
@ -25,29 +23,31 @@ import code.name.monkey.appthemehelper.util.ColorUtil.lightenColor
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsThemeActivity import code.name.monkey.retromusic.activities.base.AbsThemeActivity
import code.name.monkey.retromusic.databinding.ActivityLicenseBinding
import code.name.monkey.retromusic.extensions.drawAboveSystemBars
import code.name.monkey.retromusic.extensions.drawAboveSystemBarsWithPadding
import java.io.BufferedReader import java.io.BufferedReader
import java.io.InputStreamReader import java.io.InputStreamReader
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets
/** Created by hemanths on 2019-09-27. */ /** Created by hemanths on 2019-09-27. */
class LicenseActivity : AbsThemeActivity() { class LicenseActivity : AbsThemeActivity() {
private lateinit var binding: ActivityLicenseBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_license) binding = ActivityLicenseBinding.inflate(layoutInflater)
val toolbar = findViewById<Toolbar>(R.id.toolbar) setContentView(binding.root)
setSupportActionBar(toolbar) setSupportActionBar(binding.toolbar)
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(binding.toolbar)
toolbar.setBackgroundColor(resolveColor(this, R.attr.colorSurface))
val webView = findViewById<WebView>(R.id.license)
try { try {
val buf = StringBuilder() val buf = StringBuilder()
val json = assets.open("oldindex.html") val json = assets.open("oldindex.html")
val br = BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)) BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)).use { br ->
var str: String? var str: String?
while (br.readLine().also { str = it } != null) { while (br.readLine().also { str = it } != null) {
buf.append(str) buf.append(str)
}
} }
br.close()
// Inject color values for WebView body background and links // Inject color values for WebView body background and links
val isDark = isWindowBackgroundDark(this) val isDark = isWindowBackgroundDark(this)
@ -72,12 +72,13 @@ class LicenseActivity : AbsThemeActivity() {
lightenColor(accentColor(this)) lightenColor(accentColor(this))
) )
) )
webView.loadData(changeLog, "text/html", "UTF-8") binding.license.loadData(changeLog, "text/html", "UTF-8")
} catch (e: Throwable) { } catch (e: Throwable) {
webView.loadData( binding.license.loadData(
"<h1>Unable to load</h1><p>" + e.localizedMessage + "</p>", "text/html", "UTF-8" "<h1>Unable to load</h1><p>" + e.localizedMessage + "</p>", "text/html", "UTF-8"
) )
} }
binding.license.drawAboveSystemBars()
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {

View file

@ -17,6 +17,7 @@ import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsThemeActivity import code.name.monkey.retromusic.activities.base.AbsThemeActivity
import code.name.monkey.retromusic.databinding.ActivityWhatsNewBinding import code.name.monkey.retromusic.databinding.ActivityWhatsNewBinding
import code.name.monkey.retromusic.extensions.accentColor import code.name.monkey.retromusic.extensions.accentColor
import code.name.monkey.retromusic.extensions.drawAboveSystemBars
import code.name.monkey.retromusic.extensions.setLightStatusBarAuto import code.name.monkey.retromusic.extensions.setLightStatusBarAuto
import code.name.monkey.retromusic.extensions.setTaskDescriptionColorAuto import code.name.monkey.retromusic.extensions.setTaskDescriptionColorAuto
import code.name.monkey.retromusic.util.PreferenceUtil.lastVersion import code.name.monkey.retromusic.util.PreferenceUtil.lastVersion
@ -38,12 +39,12 @@ class WhatsNewActivity : AbsThemeActivity() {
try { try {
val buf = StringBuilder() val buf = StringBuilder()
val json = assets.open("retro-changelog.html") val json = assets.open("retro-changelog.html")
val br = BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)) BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)).use { br ->
var str: String? var str: String?
while (br.readLine().also { str = it } != null) { while (br.readLine().also { str = it } != null) {
buf.append(str) buf.append(str)
}
} }
br.close()
// Inject color values for WebView body background and links // Inject color values for WebView body background and links
val isDark = isWindowBackgroundDark(this) val isDark = isWindowBackgroundDark(this)
@ -100,6 +101,7 @@ class WhatsNewActivity : AbsThemeActivity() {
binding.tgFab.extend() binding.tgFab.extend()
} }
} }
binding.webView.drawAboveSystemBars()
} }
companion object { companion object {

View file

@ -31,15 +31,15 @@ object M3UWriter : M3UConstants {
val file = File(dir, playlist.name + "." + M3UConstants.EXTENSION) val file = File(dir, playlist.name + "." + M3UConstants.EXTENSION)
val songs = playlist.getSongs() val songs = playlist.getSongs()
if (songs.isNotEmpty()) { if (songs.isNotEmpty()) {
val bw = BufferedWriter(FileWriter(file)) BufferedWriter(FileWriter(file)).use { bw ->
bw.write(M3UConstants.HEADER) bw.write(M3UConstants.HEADER)
for (song in songs) { for (song in songs) {
bw.newLine() bw.newLine()
bw.write(M3UConstants.ENTRY + song.duration + M3UConstants.DURATION_SEPARATOR + song.artistName + " - " + song.title) bw.write(M3UConstants.ENTRY + song.duration + M3UConstants.DURATION_SEPARATOR + song.artistName + " - " + song.title)
bw.newLine() bw.newLine()
bw.write(song.data) bw.write(song.data)
}
} }
bw.close()
} }
return file return file
} }
@ -54,15 +54,15 @@ object M3UWriter : M3UConstants {
it.songPrimaryKey it.songPrimaryKey
}.toSongs() }.toSongs()
if (songs.isNotEmpty()) { if (songs.isNotEmpty()) {
val bufferedWriter = BufferedWriter(FileWriter(file)) BufferedWriter(FileWriter(file)).use { bw->
bufferedWriter.write(M3UConstants.HEADER) bw.write(M3UConstants.HEADER)
songs.forEach { songs.forEach {
bufferedWriter.newLine() bw.newLine()
bufferedWriter.write(M3UConstants.ENTRY + it.duration + M3UConstants.DURATION_SEPARATOR + it.artistName + " - " + it.title) bw.write(M3UConstants.ENTRY + it.duration + M3UConstants.DURATION_SEPARATOR + it.artistName + " - " + it.title)
bufferedWriter.newLine() bw.newLine()
bufferedWriter.write(it.data) bw.write(it.data)
}
} }
bufferedWriter.close()
} }
return file return file
} }
@ -72,15 +72,15 @@ object M3UWriter : M3UConstants {
it.songPrimaryKey it.songPrimaryKey
}.toSongs() }.toSongs()
if (songs.isNotEmpty()) { if (songs.isNotEmpty()) {
val bufferedWriter = outputStream.bufferedWriter() outputStream.bufferedWriter().use{ bw->
bufferedWriter.write(M3UConstants.HEADER) bw.write(M3UConstants.HEADER)
songs.forEach { songs.forEach {
bufferedWriter.newLine() bw.newLine()
bufferedWriter.write(M3UConstants.ENTRY + it.duration + M3UConstants.DURATION_SEPARATOR + it.artistName + " - " + it.title) bw.write(M3UConstants.ENTRY + it.duration + M3UConstants.DURATION_SEPARATOR + it.artistName + " - " + it.title)
bufferedWriter.newLine() bw.newLine()
bufferedWriter.write(it.data) bw.write(it.data)
}
} }
bufferedWriter.close()
} }
outputStream.flush() outputStream.flush()
outputStream.close() outputStream.close()

View file

@ -6,23 +6,17 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<code.name.monkey.retromusic.views.StatusBarView
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="?attr/colorSurface"
tools:ignore="UnusedAttribute" />
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"> android:background="?attr/colorSurface"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:fitsSystemWindows="true"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
@ -37,15 +31,18 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<code.name.monkey.retromusic.views.LollipopFixedWebView <code.name.monkey.retromusic.views.LollipopFixedWebView
android:id="@+id/license" android:id="@+id/license"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="wrap_content"
android:scrollbars="none"
android:fitsSystemWindows="true"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout> </LinearLayout>