forked from crosswalk-project/chromium-crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Remoting Android] Put Icons and Credits on Navigation Menu
* Add icon to match the design of the account switcher. * Add Credits on the navigation menu. BUG=548929 Review-Url: https://codereview.chromium.org/1997793002 Cr-Commit-Position: refs/heads/master@{#394998}
- Loading branch information
Showing
16 changed files
with
135 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- Copyright 2016 The Chromium Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
|
||
<ListView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:divider="@null" | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
android:paddingTop="12dp" | ||
android:paddingBottom="12dp"/> |
This file contains 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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 The Chromium Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
|
||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:drawablePadding="32dp" | ||
android:drawableStart="@drawable/ic_info" | ||
android:gravity="center_vertical" | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingTop="16dp" | ||
android:paddingBottom="20dp" | ||
android:text="@string/credits" | ||
style="@style/NavigationTextStyle"/> |
This file contains 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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 The Chromium Authors. All rights reserved. | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
|
||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:drawablePadding="32dp" | ||
android:drawableStart="@drawable/ic_help" | ||
android:gravity="center_vertical" | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingTop="16dp" | ||
android:paddingBottom="20dp" | ||
android:text="@string/actionbar_help" | ||
style="@style/NavigationTextStyle"/> |
This file contains 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
54 changes: 54 additions & 0 deletions
54
remoting/android/java/src/org/chromium/chromoting/NavigationMenuAdapter.java
This file contains 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,54 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.chromoting; | ||
|
||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.AdapterView; | ||
import android.widget.ArrayAdapter; | ||
|
||
/** | ||
* Describes the appearance and behavior of the navigation menu. This also implements | ||
* AdapterView.OnItemClickListener so it can be used as the ListView's onItemClickListener. | ||
*/ | ||
public class NavigationMenuAdapter extends ArrayAdapter<NavigationMenuAdapter.NavigationMenuItem> | ||
implements AdapterView.OnItemClickListener { | ||
/** | ||
* Defines a menu item. | ||
*/ | ||
public static class NavigationMenuItem { | ||
private int mLayoutResourceId; | ||
private Runnable mCallback; | ||
public NavigationMenuItem(int layoutResourceId, Runnable callback) { | ||
mLayoutResourceId = layoutResourceId; | ||
mCallback = callback; | ||
} | ||
} | ||
|
||
public NavigationMenuAdapter(Context context, NavigationMenuItem[] objects) { | ||
super(context, -1, objects); | ||
} | ||
|
||
/** Generates a View corresponding to the particular navigation item. */ | ||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
if (convertView == null) { | ||
NavigationMenuItem item = getItem(position); | ||
LayoutInflater inflater = | ||
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
convertView = inflater.inflate(item.mLayoutResourceId, null); | ||
} | ||
return convertView; | ||
} | ||
|
||
|
||
/** AdapterView.OnItemClickListener override. */ | ||
@Override | ||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | ||
getItem(position).mCallback.run(); | ||
} | ||
} |