This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package com.example.mear.activities
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Toast
|
||||
|
||||
import java.lang.Exception
|
||||
import kotlinx.android.synthetic.main.activity_settings.*
|
||||
@@ -12,7 +17,9 @@ import com.example.mear.adapters.SettingsAdapter
|
||||
import com.example.mear.R
|
||||
import com.example.mear.management.MusicFiles
|
||||
import com.example.mear.management.TrackManager
|
||||
import com.example.mear.ui.popups.AboutPopup
|
||||
import com.example.mear.repositories.TrackRepository
|
||||
import kotlinx.android.synthetic.main.popup_layout.*
|
||||
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
@@ -22,6 +29,16 @@ class SettingsActivity : AppCompatActivity() {
|
||||
setContentView(R.layout.activity_settings)
|
||||
setSupportActionBar(toolbar)
|
||||
|
||||
var aListener = AboutListener(aboutApp, this)
|
||||
About.setOnClickListener(aListener)
|
||||
|
||||
/**
|
||||
About.setOnClickListener {
|
||||
val i =0
|
||||
var j = i.plus(500)
|
||||
}
|
||||
*/
|
||||
|
||||
initialize()
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
}
|
||||
@@ -55,4 +72,20 @@ class SettingsActivity : AppCompatActivity() {
|
||||
private fun updateLibrary() {
|
||||
loadTracks(loadSongPaths())
|
||||
}
|
||||
|
||||
class AboutListener(var layout: LinearLayout?, val ctx: Context): View.OnClickListener {
|
||||
override fun onClick(v: View?) {
|
||||
val ss = 10
|
||||
var ob = ss.plus(500)
|
||||
try {
|
||||
val popup = AboutPopup(ctx)
|
||||
popup?.showPopupFromScreenCenter(R.layout.activity_settings)
|
||||
}
|
||||
catch (ex: Exception) {
|
||||
val exMsg = ex.message
|
||||
}
|
||||
Toast.makeText(ctx, "About Setting pressed", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.example.mear.ui.popups
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import com.example.mear.R
|
||||
|
||||
import com.xu.xpopupwindow.XPopupWindow
|
||||
|
||||
class AboutPopup(ctx: Context): XPopupWindow(ctx) {
|
||||
override fun exitAnim(view: View): Animator? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.popup_layout
|
||||
}
|
||||
|
||||
override fun getLayoutParentNodeId(): Int {
|
||||
return R.id.parent
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
}
|
||||
|
||||
override fun startAnim(view: View): Animator? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun animStyle(): Int {
|
||||
return -1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/settingList"
|
||||
android:layout_width="match_parent"
|
||||
@@ -28,10 +30,16 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/space3"
|
||||
/>
|
||||
<!--
|
||||
-->
|
||||
|
||||
<FrameLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="464dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/space3">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dm"
|
||||
@@ -39,19 +47,62 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/RefreshLibrary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:lineSpacingExtra="12sp"
|
||||
android:text="@string/update_library"
|
||||
android:textColor="@color/track_details"
|
||||
android:textColor="@color/setting_text"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/setting_text"
|
||||
android:text="@string/update_library_description"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/About"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:lineSpacingExtra="12sp"
|
||||
android:text="@string/about_header"
|
||||
android:textColor="@color/setting_text"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:lineSpacingExtra="12sp"
|
||||
android:text="@string/about_description"
|
||||
android:textColor="@color/setting_text"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
-->
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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/aboutApp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/popup_about_background"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:textAlignment="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
app:srcCompat="@mipmap/vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_version"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/popup_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/popup_about_contributors"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/popup_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_author"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/popup_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_logo_designer"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/popup_text" />
|
||||
</LinearLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
@@ -17,4 +17,11 @@
|
||||
<color name="song_searchView">@color/color_background</color>
|
||||
<color name="song_searchView_hint_text">#FFFFFF</color>
|
||||
<color name="song_searchView_text">#FFFFFF</color>
|
||||
|
||||
<!-- Settings -->
|
||||
<color name="setting_text">#FFFFFF</color>
|
||||
|
||||
<!-- Popups -->
|
||||
<color name="popup_about_background">#323232</color>
|
||||
<color name="popup_about">#FFFFFF</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<resources>
|
||||
<string name="app_name">Mear</string>
|
||||
<string name="app_version">Pre-development release</string>
|
||||
<string name="app_author">amazing-username - Kun Deng</string>
|
||||
<string name="app_logo_designer">Zularizal</string>
|
||||
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
<string name="nav_header_title">Android Studio</string>
|
||||
@@ -24,15 +28,18 @@
|
||||
|
||||
<!-- Strings related to SettingsActivity -->
|
||||
<string name="update_library">Update Music Library</string>
|
||||
<string name="update_library_description">Clear your music databas
|
||||
e and search for musiczf
|
||||
dhdfhfdhdfh
|
||||
</string>
|
||||
<string name="update_library_description">Clear your music databas e and search for music </string>
|
||||
<string name="about_header">About</string>
|
||||
<string name="about_description">Information about the software</string>
|
||||
|
||||
<!-- Music Player popup strings -->
|
||||
<string name="settings">Settings</string>
|
||||
<string name="song_view">Songs</string>
|
||||
|
||||
<!-- Popups -->
|
||||
<string name="popup_about_header">About</string>
|
||||
<string name="popup_about_contributors">Contributors</string>
|
||||
|
||||
<!-- Song Search -->
|
||||
<string name="song_search_hint">Search for songs or artists</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user