1 /* 2 * Copyright (C) 2016 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * 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, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * 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.view.Window; 22 import android.widget.ProgressBar; 23 import android.widget.TextView; 24 25 import com.googlecode.android_scripting.R; 26 import com.googlecode.android_scripting.Version; 27 28 public class CustomizeWindow { CustomizeWindow()29 private CustomizeWindow() { 30 // Utility class. 31 } 32 requestCustomTitle(Activity activity, String title, int contentViewLayoutResId)33 public static void requestCustomTitle(Activity activity, String title, int contentViewLayoutResId) { 34 //b/26218264 35 //activity.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 36 //activity.setContentView(contentViewLayoutResId); 37 //activity.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title); 38 //((TextView) activity.findViewById(R.id.left_text)).setText(title); 39 //((TextView) activity.findViewById(R.id.right_text)).setText("SL4A r" 40 // + Version.getVersion(activity)); 41 } 42 toggleProgressBarVisibility(Activity activity, boolean on)43 public static void toggleProgressBarVisibility(Activity activity, boolean on) { 44 ((ProgressBar) activity.findViewById(R.id.progress_bar)).setVisibility(on ? View.VISIBLE 45 : View.GONE); 46 } 47 } 48