Added "dashboard" - list of live streams. Also removed the excess space at the top of the main activity for the disabled action bar
This commit is contained in:
parent
279b9c5d5f
commit
d69aeece54
18 changed files with 479 additions and 38 deletions
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
@ -5,7 +5,7 @@
|
|||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -17,6 +17,11 @@ android {
|
|||
|
||||
compileOptions {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
@ -30,21 +35,21 @@ android {
|
|||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.core:core-ktx:1.0.2'
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.core:core-ktx:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.0.0'
|
||||
implementation 'androidx.navigation:navigation-ui:2.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
|
||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.2.1'
|
||||
implementation 'androidx.navigation:navigation-ui:2.2.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.1'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-hls:2.11.1'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.1'
|
||||
implementation 'com.android.volley:volley:1.1.1'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.material.lists;
|
||||
|
||||
import net.theoks.customstreams.android.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
/** A simple single line list item. */
|
||||
public class SingleLineItemViewHolder extends ViewHolder {
|
||||
|
||||
public final ImageView icon;
|
||||
public final TextView text;
|
||||
|
||||
public SingleLineItemViewHolder(@NonNull View view) {
|
||||
super(view);
|
||||
this.icon = itemView.findViewById(R.id.mtrl_list_item_icon);
|
||||
this.text = itemView.findViewById(R.id.mtrl_list_item_text);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static SingleLineItemViewHolder create(@NonNull ViewGroup parent) {
|
||||
return new SingleLineItemViewHolder(LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.material_list_item_single_line, parent, false));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.material.lists;
|
||||
|
||||
import net.theoks.customstreams.android.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
/** A simple three line list item. */
|
||||
public class ThreeLineItemViewHolder extends TwoLineItemViewHolder {
|
||||
|
||||
public final TextView tertiary;
|
||||
|
||||
public ThreeLineItemViewHolder(@NonNull View view) {
|
||||
super(view);
|
||||
this.tertiary = itemView.findViewById(R.id.mtrl_list_item_tertiary_text);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ThreeLineItemViewHolder create(@NonNull ViewGroup parent) {
|
||||
return new ThreeLineItemViewHolder(
|
||||
LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.material_list_item_three_line, parent, false));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.material.lists;
|
||||
|
||||
import net.theoks.customstreams.android.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
/** A simple two line list item. */
|
||||
public class TwoLineItemViewHolder extends SingleLineItemViewHolder {
|
||||
|
||||
public final TextView secondary;
|
||||
|
||||
public TwoLineItemViewHolder(@NonNull View view) {
|
||||
super(view);
|
||||
this.secondary = itemView.findViewById(R.id.mtrl_list_item_secondary_text);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static TwoLineItemViewHolder create(@NonNull ViewGroup parent) {
|
||||
return new TwoLineItemViewHolder(
|
||||
LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.material_list_item_two_line, parent, false));
|
||||
}
|
||||
}
|
|
@ -20,11 +20,11 @@ class MainActivity : AppCompatActivity() {
|
|||
// menu should be considered as top level destinations.
|
||||
// val appBarConfiguration = AppBarConfiguration(
|
||||
// setOf(
|
||||
// R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_player
|
||||
// R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_settings
|
||||
// )
|
||||
// )
|
||||
// setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
actionBar?.hide()
|
||||
// actionBar?.hide()
|
||||
navView.setupWithNavController(navController)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,28 @@
|
|||
package net.theoks.customstreams.android.ui.dashboard
|
||||
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
//import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.android.volley.Request
|
||||
import com.android.volley.Response
|
||||
import com.android.volley.toolbox.JsonArrayRequest
|
||||
import com.android.volley.toolbox.Volley
|
||||
import com.google.android.material.lists.SingleLineItemViewHolder
|
||||
import net.theoks.customstreams.android.R
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import com.google.android.material.lists.ThreeLineItemViewHolder
|
||||
import com.google.android.material.lists.TwoLineItemViewHolder
|
||||
|
||||
class DashboardFragment : Fragment() {
|
||||
|
||||
|
@ -19,13 +33,74 @@ class DashboardFragment : Fragment() {
|
|||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
dashboardViewModel =
|
||||
ViewModelProviders.of(this).get(DashboardViewModel::class.java)
|
||||
// dashboardViewModel =
|
||||
// ViewModelProviders.of(this).get(DashboardViewModel::class.java)
|
||||
val root = inflater.inflate(R.layout.fragment_dashboard, container, false)
|
||||
// val textView: TextView = root.findViewById(R.id.text_dashboard)
|
||||
// dashboardViewModel.text.observe(this, Observer {
|
||||
// textView.text = it
|
||||
// })
|
||||
val recyclerView = root.findViewById<RecyclerView>(R.id.dashboard_recycler_view)
|
||||
recyclerView.layoutManager = LinearLayoutManager(context)
|
||||
recyclerView.adapter = DashboardAdapter()
|
||||
|
||||
val queue = Volley.newRequestQueue(context)
|
||||
val url = "https://buyvm-cf.theoks.net/custom-streams-player/get_stream_list.php"
|
||||
val streamListJsonRequest = JsonArrayRequest(Request.Method.GET, url, null,
|
||||
Response.Listener<JSONArray> {
|
||||
val stringArr = arrayOfNulls<String>(it.length())
|
||||
for(i in 0 until it.length()) {
|
||||
val thisItem = it.get(i) as JSONObject
|
||||
if(thisItem["stream_is_game"] as Boolean) {
|
||||
stringArr[i] = "${thisItem["stream_key"]}\n${thisItem["stream_title"]}\nPlaying ${thisItem["stream_game_name"]}"
|
||||
} else {
|
||||
stringArr[i] = "${thisItem["stream_key"]}\n${thisItem["stream_title"]}"
|
||||
}
|
||||
}
|
||||
(recyclerView.adapter as DashboardAdapter).receiveData(stringArr)
|
||||
},
|
||||
Response.ErrorListener { Log.e("OKSCustom-StreamList", "Error when requesting list of streams.") })
|
||||
queue.add(streamListJsonRequest)
|
||||
return root
|
||||
}
|
||||
|
||||
class DashboardAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var dataMessages = arrayOf("Loading..")
|
||||
|
||||
fun receiveData(data: Array<String?>) {
|
||||
dataMessages = data.requireNoNulls()
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, position: Int): RecyclerView.ViewHolder {
|
||||
return ThreeLineItemViewHolder.create(parent)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
var message = "We don't have data for this ViewHolder!"
|
||||
if(position < dataMessages.size) message = dataMessages[position]
|
||||
bind(holder as ThreeLineItemViewHolder, message)
|
||||
}
|
||||
|
||||
private fun bind(vh: ThreeLineItemViewHolder, str: String) {
|
||||
val split = str.split("\n")
|
||||
vh.text.text = split[0]
|
||||
vh.text.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
|
||||
if(split.size > 1)
|
||||
{
|
||||
vh.secondary.text = split[1]
|
||||
vh.secondary.ellipsize = TextUtils.TruncateAt.END
|
||||
}
|
||||
if(split.size > 2) {
|
||||
vh.tertiary.text = split[2]
|
||||
vh.secondary.ellipsize = TextUtils.TruncateAt.END
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return dataMessages.size
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if(position >= dataMessages.size) return 1
|
||||
return dataMessages[position].split("\n").size
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,26 +12,27 @@ import android.widget.TextView
|
|||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
//import androidx.lifecycle.ViewModelProviders
|
||||
import com.android.volley.Request
|
||||
import com.android.volley.Response
|
||||
import com.android.volley.toolbox.JsonObjectRequest
|
||||
import com.android.volley.toolbox.Volley
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import net.theoks.customstreams.android.PlayerActivity
|
||||
import net.theoks.customstreams.android.R
|
||||
import org.json.JSONObject
|
||||
|
||||
class HomeFragment : Fragment() {
|
||||
|
||||
private lateinit var homeViewModel: HomeViewModel
|
||||
// private lateinit var homeViewModel: HomeViewModel
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
homeViewModel =
|
||||
ViewModelProviders.of(this).get(HomeViewModel::class.java)
|
||||
// homeViewModel =
|
||||
// ViewModelProviders.of(this).get(HomeViewModel::class.java)
|
||||
val root = inflater.inflate(R.layout.fragment_home, container, false)
|
||||
|
||||
val button = root.findViewById(R.id.watchButton) as Button
|
||||
|
@ -39,7 +40,7 @@ class HomeFragment : Fragment() {
|
|||
val streamKey = (it.rootView.findViewById(R.id.streamKeyEdit) as EditText).text.toString()
|
||||
Log.i("OKSCustomHome", "Button pressed, found stream key $streamKey")
|
||||
|
||||
var queue = Volley.newRequestQueue(it.context)
|
||||
val queue = Volley.newRequestQueue(it.context)
|
||||
val url = "https://buyvm-cf.theoks.net/custom-streams-player/get_title.php?streamkey=$streamKey"
|
||||
val streamInfoJsonRequest = JsonObjectRequest(Request.Method.GET, url, null, Response.Listener<JSONObject> {
|
||||
if(it.getBoolean("stream_is_live")) {
|
||||
|
@ -48,10 +49,9 @@ class HomeFragment : Fragment() {
|
|||
}
|
||||
startActivity(intent)
|
||||
} else {
|
||||
val builder = AlertDialog.Builder(context ?: throw Exception("Couldn't get context while building alert"))
|
||||
builder.setMessage("Stream $streamKey is not live.").setNeutralButton(R.string.ok, null)
|
||||
val builder = MaterialAlertDialogBuilder(context ?: throw Exception("Couldn't get context while building alert"))
|
||||
builder.setTitle(R.string.stream_not_live).setMessage("Stream $streamKey is not live.").setPositiveButton(R.string.ok, null).show()
|
||||
Log.i("OKSCustom-StreamInfo", "Stream $streamKey is not live!")
|
||||
builder.create()
|
||||
}
|
||||
},
|
||||
Response.ErrorListener {Log.e("OKSCustom-StreamInfo", "Error when requesting stream info ${it.message}")})
|
||||
|
|
19
app/src/main/res/color/mtrl_list_item_tint.xml
Normal file
19
app/src/main/res/color/mtrl_list_item_tint.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 The Android Open Source Project
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:alpha="0.87" android:color="?attr/colorOnSurface"/>
|
||||
|
||||
</selector>
|
27
app/src/main/res/drawable/logo_avatar_anonymous_40dp.xml
Normal file
27
app/src/main/res/drawable/logo_avatar_anonymous_40dp.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
Copyright (C) 2019 The Android Open Source Project
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="40dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="192"
|
||||
android:viewportHeight="192">
|
||||
<path
|
||||
android:pathData="M96,0C43.01,0 0,43.01 0,96s43.01,96 96,96s96,-43.01 96,-96S148.99,0 96,0z"
|
||||
android:fillColor="#E0E0E0"/>
|
||||
<path
|
||||
android:pathData="M96,85.09c13.28,0 24,-10.72 24,-24c0,-13.28 -10.72,-24 -24,-24s-24,10.72 -24,24C72,74.37 82.72,85.09 96,85.09z"
|
||||
android:fillColor="#BDBDBD"/>
|
||||
<path
|
||||
android:pathData="M96,99.27c-29.33,0 -52.36,14.18 -52.36,27.27c11.09,17.06 30.51,28.36 52.36,28.36s41.27,-11.3 52.36,-28.36C148.36,113.45 125.33,99.27 96,99.27z"
|
||||
android:fillColor="#BDBDBD"/>
|
||||
</vector>
|
|
@ -3,8 +3,8 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="?attr/actionBarSize">
|
||||
android:layout_height="match_parent">
|
||||
<!-- android:paddingTop="?attr/actionBarSize"-->
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_dashboard"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold"/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/dashboard_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:clipToPadding="false"/>
|
||||
</LinearLayout>
|
||||
|
|
6
app/src/main/res/layout/list_item_dashboard.xml
Normal file
6
app/src/main/res/layout/list_item_dashboard.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</TextView>
|
42
app/src/main/res/layout/material_list_item_single_line.xml
Normal file
42
app/src/main/res/layout/material_list_item_single_line.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2019 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:minHeight="?attr/minTouchTargetSize">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mtrl_list_item_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceSubtitle1"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
</LinearLayout>
|
66
app/src/main/res/layout/material_list_item_three_line.xml
Normal file
66
app/src/main/res/layout/material_list_item_three_line.xml
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2019 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:minHeight="88dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mtrl_list_item_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:padding="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_toEndOf="@id/mtrl_list_item_icon"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceSubtitle1"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_secondary_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/mtrl_list_item_text"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_toEndOf="@id/mtrl_list_item_icon"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_tertiary_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/mtrl_list_item_secondary_text"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_toEndOf="@id/mtrl_list_item_icon"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
</RelativeLayout>
|
52
app/src/main/res/layout/material_list_item_two_line.xml
Normal file
52
app/src/main/res/layout/material_list_item_two_line.xml
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2019 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:minHeight="64dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mtrl_list_item_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@id/mtrl_list_item_icon"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceSubtitle1"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mtrl_list_item_secondary_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/mtrl_list_item_text"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_toEndOf="@id/mtrl_list_item_icon"
|
||||
android:paddingEnd="16dp"
|
||||
android:maxLines="2"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:textColor="@color/mtrl_list_item_tint"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,11 +1,12 @@
|
|||
<resources>
|
||||
<string name="app_name">OKS Streams</string>
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_dashboard">Dashboard</string>
|
||||
<string name="title_dashboard">Live Streams</string>
|
||||
<string name="stream_key_hint">Stream Key</string>
|
||||
<string name="watch_button_label">Watch</string>
|
||||
<string name="oks_custom_streams">OKS Custom Streams</string>
|
||||
<string name="title_player">Player</string>
|
||||
<string name="title_settings">Settings</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="stream_not_live">Stream Not Live</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
<style name="AppTheme.NoActionBar" parent="AppTheme">
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue