タグ付けされた質問 「android-design-library」

Designパッケージは、アプリへのマテリアルデザインコンポーネントとパターンの追加をサポートするAPIを提供します。

2
AppBarLayoutによるオーバーラップスクロールビュー
このビデオのように、マテリアルデザインのスクロールテクニックから「コンテンツが重複しているフレキシブルスペース」パターンを実装したいと思います。 私のXMLレイアウトは次のようになります。 <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="192dp" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:layout_height="?attr/actionBarSize" android:layout_width="match_parent" app:layout_collapseMode="pin"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <....> </LinearLayout> </android.support.v4.widget.NestedScrollView> </android.support.design.widget.CoordinatorLayout> デザインライブラリを使用してこれを実現する簡単な方法はありますか?または、これを行うにはカスタムCoordinatorLayout.Behaviorを構築する必要がありますか?

16
ユーザーがフォーカスする前に、TextInputLayoutにEditTextヒントが表示されない
EditTextsでフローティングラベルを表示するために、最近リリースされたAndroid Design Support Libraryを使用しています。しかし、UIがレンダリングされたときにEditTextのヒントが表示されないという問題に直面していますが、EditTextにフォーカスするとヒントが表示されます。 私のレイアウトは次のとおりです: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:id="@+id/ScrollView01" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"> <android.support.design.widget.TextInputLayout android:id="@+id/name_et_textinputlayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/activity_vertical_margin"> <EditText android:id="@+id/FeedBackerNameET" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/feedbackname" android:inputType="textPersonName|textCapWords" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:id="@+id/email_textinputlayout" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/FeedBackerEmailET" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/feedbackemail" android:inputType="textEmailAddress" /> …

7
CoordinatorLayoutとは何ですか?
新しいAndroidサポートデザインライブラリのデモアプリを見たところです。githubの Chris Banesが提供しています。アプリ全体で、頻繁にCoordinatorLayout使用されます。また、のようなサポート設計ライブラリクラスの多くのFloatingActionButton、SnackBar、AppBarLayoutときに使用される内部などが異なる挙動をCoordinatorLayout。 誰かが何かにいくつかのライトを当てるしてくださいすることができCoordinatorLayout、それが他と異なっているとどのようにViewGroupアンドロイドでの、または少なくとも学習に向けて正しいパスを提供しますCoordinatorLayout。

22
サポートライブラリのスナックバーのテキストの色をandroid:textColor以外に設定するにはどうすればよいですか?
そこで、デザインサポートライブラリで新しいスナックバーを使い始めましたが、テーマで「android:textColor」を定義すると、スナックバーのテキストの色に適用されることがわかりました。プライマリテキストの色が暗い場合、これは明らかに問題です。 これを回避する方法を知っている人や、テキストに色を付ける方法についてのアドバイスはありますか? 2017年1月の編集:(回答後) 以下に問題を修正するためのカスタムソリューションがいくつかありますが、スナックバーのテーマを設定する正しい方法を提供することはおそらく良いことです。 まず、おそらくandroid:textColorテーマで何も定義するべきではありません(テーマを使用する対象の範囲を本当に理解している場合を除きます)。これにより、基本的に、テーマに接続するすべてのビューのテキストの色が設定されます。デフォルトではないビューのテキストの色を定義する場合android:primaryTextColorは、カスタムビューでその属性を使用して参照します。 ただし、テーマをSnackbarに適用する場合は、サードパーティのマテリアルドキュメントからこの品質ガイドを参照してください:http : //www.materialdoc.com/snackbar/(プログラムによるテーマの実装に従って、XMLスタイルに依存しないようにしてください) 参考のため: // create instance Snackbar snackbar = Snackbar.make(view, text, duration); // set action button color snackbar.setActionTextColor(getResources().getColor(R.color.indigo)); // get snackbar view View snackbarView = snackbar.getView(); // change snackbar text color int snackbarTextId = android.support.design.R.id.snackbar_text; TextView textView = (TextView)snackbarView.findViewById(snackbarTextId); textView.setTextColor(getResources().getColor(R.color.indigo)); // change snackbar background …

16
Androidマルチラインスナックバー
http://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-specsにSnackbar示すように、Android Design SupportLibraryの新しい機能を利用して複数行のスナックバーを表示しようとしています。 import android.support.design.widget.Snackbar; final String snack = "First line\nSecond line\nThird line"; Snackbar.make(mView, snack, Snackbar.LENGTH_LONG).show(); First line...Nexus 7にのみ表示されます。すべての行を表示するにはどうすればよいですか? PS:試してみたところToast、すべての行が表示されました。


2
NavigationViewとカスタムレイアウト
私は次のNavigationViewようなデザインサポートライブラリを使用しています: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_height="match_parent" android:layout_width="match_parent" android:fitsSystemWindows="true"> <!-- put your main layout here --> <include layout="@layout/drawer_main_layout"/> <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_height="match_parent" android:layout_width="wrap_content" android:layout_gravity="start" android:fitsSystemWindows="true" app:headerLayout="@layout/nav_header" app:menu="@menu/drawer_view"/> </android.support.v4.widget.DrawerLayout> そして私はこのメニューを設定しました: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_home" android:icon="@drawable/ic_dashboard" android:title="Home" /> <item android:id="@+id/nav_messages" android:icon="@drawable/ic_event" android:title="Messages" /> <item android:id="@+id/nav_friends" android:icon="@drawable/ic_headset" android:title="Friends" /> <item android:id="@+id/nav_discussion" android:icon="@drawable/ic_forum" android:title="Discussion" …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.