Skip to content

Commit f9b7f9f

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Support route grouping in the MediaRouter dialog UI." into jb-dev
2 parents 15c9c61 + d6d0bdd commit f9b7f9f

17 files changed

+689
-49
lines changed

core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java

Lines changed: 371 additions & 22 deletions
Large diffs are not rendered by default.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.view;
18+
19+
import com.android.internal.R;
20+
21+
import android.content.Context;
22+
import android.util.AttributeSet;
23+
import android.widget.Checkable;
24+
import android.widget.CheckBox;
25+
import android.widget.LinearLayout;
26+
27+
public class CheckableLinearLayout extends LinearLayout implements Checkable {
28+
private CheckBox mCheckBox;
29+
30+
public CheckableLinearLayout(Context context) {
31+
super(context);
32+
// TODO Auto-generated constructor stub
33+
}
34+
35+
public CheckableLinearLayout(Context context, AttributeSet attrs) {
36+
super(context, attrs);
37+
// TODO Auto-generated constructor stub
38+
}
39+
40+
public CheckableLinearLayout(Context context, AttributeSet attrs, int defStyle) {
41+
super(context, attrs, defStyle);
42+
// TODO Auto-generated constructor stub
43+
}
44+
45+
@Override
46+
protected void onFinishInflate() {
47+
super.onFinishInflate();
48+
mCheckBox = (CheckBox) findViewById(R.id.check);
49+
}
50+
51+
@Override
52+
public void setChecked(boolean checked) {
53+
mCheckBox.setChecked(checked);
54+
}
55+
56+
@Override
57+
public boolean isChecked() {
58+
return mCheckBox.isChecked();
59+
}
60+
61+
@Override
62+
public void toggle() {
63+
mCheckBox.toggle();
64+
}
65+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.view;
18+
19+
import android.content.Context;
20+
import android.util.AttributeSet;
21+
import android.view.ViewGroup;
22+
import android.widget.ImageButton;
23+
24+
public class ImageButtonNoParentPress extends ImageButton {
25+
26+
public ImageButtonNoParentPress(Context context) {
27+
super(context);
28+
}
29+
30+
public ImageButtonNoParentPress(Context context, AttributeSet attrs) {
31+
super(context, attrs);
32+
}
33+
34+
public ImageButtonNoParentPress(Context context, AttributeSet attrs, int defStyle) {
35+
super(context, attrs, defStyle);
36+
}
37+
38+
@Override
39+
public void setPressed(boolean pressed) {
40+
// Normally parents propagate pressed state to their children.
41+
// We don't want that to happen here; only press if our parent isn't.
42+
super.setPressed(((ViewGroup) getParent()).isPressed() ? false : pressed);
43+
}
44+
}
933 Bytes
Loading
984 Bytes
Loading
720 Bytes
Loading
751 Bytes
Loading
1.33 KB
Loading
1.32 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2012 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
18+
19+
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
20+
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled_holo_light" />
21+
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled_holo_light" />
22+
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
23+
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition_holo_light" />
24+
<item android:state_focused="true" android:drawable="@drawable/list_focused_holo" />
25+
<item android:state_activated="true" android:drawable="@android:drawable/list_activated_holo" />
26+
<item android:drawable="@color/transparent" />
27+
</selector>

0 commit comments

Comments
 (0)