-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Jetcaster/tv support #1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chikoski
merged 5 commits into
android:jetcaster/all_form_factors
from
chikoski:jetcaster/tv-support
Mar 21, 2024
Merged
Jetcaster/tv support #1286
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bef10b8
add tv-module
chikoski 7630c33
Apply font and color settings defined in the designsystem module to t…
chikoski 55bac65
Add license information
chikoski 38b22d6
Fix format error in the tv-app module
chikoski b1bdaca
Update include clause to be consistent with the project standards
chikoski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /* | ||
| * Copyright 2024 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. | ||
| */ | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.android.application) | ||
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.ksp) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.example.jetcaster.tv" | ||
| compileSdk = libs.versions.compileSdk.get().toInt() | ||
|
|
||
| defaultConfig { | ||
| applicationId = "com.example.jetcaster" | ||
| minSdk = libs.versions.minSdk.get().toInt() | ||
| targetSdk = libs.versions.targetSdk.get().toInt() | ||
| versionCode = 1 | ||
| versionName = "1.0" | ||
| vectorDrawables { | ||
| useSupportLibrary = true | ||
| } | ||
|
|
||
| } | ||
|
|
||
| buildTypes { | ||
| getByName("release") { | ||
| isMinifyEnabled = true | ||
| proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro") | ||
| } | ||
| } | ||
|
|
||
| compileOptions { | ||
| isCoreLibraryDesugaringEnabled = true | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| buildFeatures { | ||
| compose = true | ||
| } | ||
| composeOptions { | ||
| kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() | ||
| } | ||
| packaging { | ||
| resources { | ||
| // The Rome library JARs embed some internal utils libraries in nested JARs. | ||
| // We don't need them so we exclude them in the final package. | ||
| excludes += "/*.jar" | ||
| excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.appcompat) | ||
| implementation(platform(libs.androidx.compose.bom)) | ||
| implementation(libs.androidx.compose.ui.tooling.preview) | ||
| implementation(libs.androidx.tv.foundation) | ||
| implementation(libs.androidx.tv.material) | ||
| implementation(libs.androidx.lifecycle.runtime) | ||
| implementation(libs.androidx.activity.compose) | ||
|
|
||
| implementation(project(":core")) | ||
| implementation(project(":designsystem")) | ||
|
|
||
| androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
| androidTestImplementation(libs.androidx.compose.ui.test.junit4) | ||
| debugImplementation(libs.androidx.compose.ui.tooling) | ||
| debugImplementation(libs.androidx.compose.ui.test.manifest) | ||
|
|
||
| coreLibraryDesugaring(libs.core.jdk.desugaring) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| Copyright 2024 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. | ||
| --> | ||
|
|
||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| <uses-feature | ||
| android:name="android.hardware.touchscreen" | ||
| android:required="false" /> | ||
| <uses-feature | ||
| android:name="android.software.leanback" | ||
| android:required="false" /> | ||
|
|
||
| <application | ||
| android:allowBackup="true" | ||
| android:banner="@mipmap/ic_launcher" | ||
| android:icon="@mipmap/ic_launcher" | ||
| android:label="@string/app_name" | ||
| android:supportsRtl="true" | ||
| android:theme="@style/Theme.Jetcaster"> | ||
| <activity | ||
| android:name=".MainActivity" | ||
| android:exported="true"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
|
|
||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
| </application> | ||
|
|
||
| </manifest> |
64 changes: 64 additions & 0 deletions
64
Jetcaster/tv-app/src/main/java/com/example/jetcaster/tv/MainActivity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /* | ||
| * Copyright 2024 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. | ||
| */ | ||
|
|
||
| package com.example.jetcaster.tv | ||
|
|
||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.RectangleShape | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.tv.material3.ExperimentalTvMaterial3Api | ||
| import androidx.tv.material3.Surface | ||
| import androidx.tv.material3.Text | ||
| import com.example.jetcaster.tv.ui.theme.JetcasterTheme | ||
|
|
||
| class MainActivity : ComponentActivity() { | ||
| @OptIn(ExperimentalTvMaterial3Api::class) | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| setContent { | ||
| JetcasterTheme { | ||
| Surface( | ||
| modifier = Modifier.fillMaxSize(), | ||
| shape = RectangleShape | ||
| ) { | ||
| Greeting("Android and World") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @OptIn(ExperimentalTvMaterial3Api::class) | ||
| @Composable | ||
| fun Greeting(name: String, modifier: Modifier = Modifier) { | ||
| Text( | ||
| text = "Hello $name!", | ||
| modifier = modifier | ||
| ) | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun GreetingPreview() { | ||
| JetcasterTheme { | ||
| Greeting("Android") | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.