1 /* 2 * Copyright (C) 2017 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.googlecode.android_scripting.activity; 18 19 import android.app.Activity; 20 import android.view.View; 21 import android.widget.ProgressBar; 22 23 import com.googlecode.android_scripting.R; 24 25 public class CustomizeWindow { CustomizeWindow()26 private CustomizeWindow() { 27 // Utility class. 28 } 29 requestCustomTitle(Activity activity, String title, int contentViewLayoutResId)30 public static void requestCustomTitle(Activity activity, String title, int contentViewLayoutResId) { 31 //b/26218264 32 //activity.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 33 //activity.setContentView(contentViewLayoutResId); 34 //activity.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title); 35 //((TextView) activity.findViewById(R.id.left_text)).setText(title); 36 //((TextView) activity.findViewById(R.id.right_text)).setText("SL4A r" 37 // + Version.getVersion(activity)); 38 } 39 toggleProgressBarVisibility(Activity activity, boolean on)40 public static void toggleProgressBarVisibility(Activity activity, boolean on) { 41 ((ProgressBar) activity.findViewById(R.id.progress_bar)).setVisibility(on ? View.VISIBLE 42 : View.GONE); 43 } 44 } 45