Add suggestion carousel view and dependencies to settings
Bug: 27752219 Change-Id: Idc14227990c902c04de5bfb6649efb6da64c9168
This commit is contained in:
@@ -9,6 +9,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
|
|||||||
android-support-v7-preference \
|
android-support-v7-preference \
|
||||||
android-support-v7-appcompat \
|
android-support-v7-appcompat \
|
||||||
android-support-v14-preference \
|
android-support-v14-preference \
|
||||||
|
android-support-v7-cardview \
|
||||||
jsr305
|
jsr305
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
@@ -21,7 +22,8 @@ LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
|
|||||||
frameworks/support/v7/preference/res \
|
frameworks/support/v7/preference/res \
|
||||||
frameworks/support/v14/preference/res \
|
frameworks/support/v14/preference/res \
|
||||||
frameworks/support/v7/appcompat/res \
|
frameworks/support/v7/appcompat/res \
|
||||||
frameworks/support/v7/recyclerview/res
|
frameworks/support/v7/recyclerview/res \
|
||||||
|
frameworks/support/v7/cardview/res
|
||||||
|
|
||||||
LOCAL_PACKAGE_NAME := Settings
|
LOCAL_PACKAGE_NAME := Settings
|
||||||
LOCAL_CERTIFICATE := platform
|
LOCAL_CERTIFICATE := platform
|
||||||
@@ -30,7 +32,7 @@ LOCAL_PRIVILEGED_MODULE := true
|
|||||||
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
||||||
|
|
||||||
LOCAL_AAPT_FLAGS := --auto-add-overlay \
|
LOCAL_AAPT_FLAGS := --auto-add-overlay \
|
||||||
--extra-packages android.support.v7.preference:android.support.v14.preference:android.support.v17.preference:android.support.v7.appcompat:android.support.v7.recyclerview
|
--extra-packages android.support.v7.preference:android.support.v14.preference:android.support.v17.preference:android.support.v7.appcompat:android.support.v7.recyclerview:android.support.v7.cardview
|
||||||
|
|
||||||
ifneq ($(INCREMENTAL_BUILDS),)
|
ifneq ($(INCREMENTAL_BUILDS),)
|
||||||
LOCAL_PROGUARD_ENABLED := disabled
|
LOCAL_PROGUARD_ENABLED := disabled
|
||||||
|
38
res/layout/suggestion_carousel_card_view.xml
Normal file
38
res/layout/suggestion_carousel_card_view.xml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
card_view:cardCornerRadius="1dp"
|
||||||
|
card_view:cardElevation="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.android.settings.dashboard;
|
||||||
|
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.android.settings.R;
|
||||||
|
|
||||||
|
public final class SuggestionCarouselAdapter
|
||||||
|
extends RecyclerView.Adapter<SuggestionCarouselAdapter.SuggestionCarouselViewHolder> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuggestionCarouselViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
final View itemView = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.suggestion_carousel_card_view, parent,
|
||||||
|
false /* attachToRoot */);
|
||||||
|
return new SuggestionCarouselViewHolder(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(SuggestionCarouselViewHolder holder, int position) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class SuggestionCarouselViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
public ImageView mImageView;
|
||||||
|
public TextView mTextView;
|
||||||
|
|
||||||
|
public SuggestionCarouselViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
mImageView = (ImageView) itemView.findViewById(R.id.image);
|
||||||
|
mTextView = (TextView) itemView.findViewById(R.id.title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user