1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5  * except in compliance with the License. You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the
10  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */
14 
15 package com.android.systemui.qs.customize;
16 
17 import android.content.Context;
18 import android.view.View;
19 import android.widget.TextView;
20 
21 import com.android.systemui.plugins.qs.QSIconView;
22 import com.android.systemui.plugins.qs.QSTile;
23 import com.android.systemui.qs.tileimpl.QSTileView;
24 
25 public class CustomizeTileView extends QSTileView {
26     private boolean mShowAppLabel;
27 
CustomizeTileView(Context context, QSIconView icon)28     public CustomizeTileView(Context context, QSIconView icon) {
29         super(context, icon);
30     }
31 
setShowAppLabel(boolean showAppLabel)32     public void setShowAppLabel(boolean showAppLabel) {
33         mShowAppLabel = showAppLabel;
34         mSecondLine.setVisibility(showAppLabel ? View.VISIBLE : View.GONE);
35         mLabel.setSingleLine(showAppLabel);
36     }
37 
38     @Override
handleStateChanged(QSTile.State state)39     protected void handleStateChanged(QSTile.State state) {
40         super.handleStateChanged(state);
41         mSecondLine.setVisibility(mShowAppLabel ? View.VISIBLE : View.GONE);
42     }
43 
getAppLabel()44     public TextView getAppLabel() {
45         return mSecondLine;
46     }
47 
48     @Override
animationsEnabled()49     protected boolean animationsEnabled() {
50         return false;
51     }
52 }
53