Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
google-automerger committed Feb 16, 2018
1 parent daed687 commit 8ab98af
Show file tree
Hide file tree
Showing 58 changed files with 1,407 additions and 455 deletions.
14 changes: 6 additions & 8 deletions Application/build.gradle
Expand Up @@ -2,20 +2,19 @@
buildscript {
repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

apply plugin: 'com.android.application'

repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
}

dependencies {
Expand All @@ -34,14 +33,13 @@ List<String> dirs = [
'template'] // boilerplate code that is generated by the sample template process

android {

compileSdkVersion 26
compileSdkVersion 27

buildToolsVersion "26.0.1"
buildToolsVersion "27.0.2"

defaultConfig {
minSdkVersion 21
targetSdkVersion 26
targetSdkVersion 27
}

compileOptions {
Expand Down
444 changes: 0 additions & 444 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,8 +8,8 @@ support library.
Pre-requisites
--------------

- Android SDK 26
- Android Build Tools v26.0.1
- Android SDK 27
- Android Build Tools v27.0.2
- Android Support Repository

Getting Started
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
15 changes: 15 additions & 0 deletions kotlinApp/.google/packaging.yaml
@@ -0,0 +1,15 @@
# GOOGLE SAMPLE PACKAGING DATA
#
# This file is used by Google as part of our samples packaging process.
# End users may safely ignore this file. It has no relevance to other systems.
---

status: PUBLISHED
technologies: [Android]
categories: [UI]
languages: [Kotlin]
solutions: [Mobile]
github: googlesamples/android-Navigation Drawer
level: BEGINNER
icon: Navigation DrawerSample/src/main/res/drawable-xxhdpi/ic_launcher.png
license: apache2
35 changes: 35 additions & 0 deletions kotlinApp/Application/build.gradle
@@ -0,0 +1,35 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.example.android.navigationdrawer"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
java.srcDirs "src/main/java"
res.srcDirs "src/main/res"
}
androidTest.setRoot('tests')
androidTest.java.srcDirs = ['tests/src']
}
}

dependencies {
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:cardview-v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
}
41 changes: 41 additions & 0 deletions kotlinApp/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 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"
package="com.example.android.navigationdrawer">

<application
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".NavigationDrawerActivity"
android:label="@string/app_name" >
</activity>
</application>

</manifest>
@@ -0,0 +1,76 @@
/*
* Copyright (C) 2018 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.example.android.navigationdrawer

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.BaseAdapter
import android.widget.GridView
import android.widget.TextView

/**
* A simple launcher activity offering access to the individual samples in this project.
*/
class MainActivity : Activity(), AdapterView.OnItemClickListener {

private lateinit var samples: Array<Sample>

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

// Prepare list of samples in this dashboard.
samples = arrayOf(Sample(R.string.navigationdraweractivity_title,
R.string.navigationdraweractivity_description,
Intent(this, NavigationDrawerActivity::class.java)))

// Prepare the GridView.
findViewById<GridView>(android.R.id.list).run {
adapter = SampleAdapter()
onItemClickListener = this@MainActivity
}
}

override fun onItemClick(container: AdapterView<*>, view: View, position: Int, id: Long) {
startActivity(samples[position].intent)
}

private inner class SampleAdapter : BaseAdapter() {

override fun getCount() = samples.size

override fun getItem(position: Int) = samples[position]

override fun getItemId(position: Int) = samples[position].hashCode().toLong()

override fun getView(position: Int, convertView: View?, container: ViewGroup): View {
return (convertView ?: layoutInflater.inflate(R.layout.sample_dashboard_item,
container, false)).apply {
findViewById<TextView>(android.R.id.text1)?.setText(
samples[position].titleResId)
findViewById<TextView>(android.R.id.text2)?.setText(
samples[position].descriptionResId)
}
}

}

}

0 comments on commit 8ab98af

Please sign in to comment.