当前位置: 首页>>代码示例>>Java>>正文


Java Button.setAllCaps方法代码示例

本文整理汇总了Java中android.widget.Button.setAllCaps方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setAllCaps方法的具体用法?Java Button.setAllCaps怎么用?Java Button.setAllCaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Button的用法示例。


在下文中一共展示了Button.setAllCaps方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createGoToEndButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to go to the end of the test view.
 *
 * @return the button, not null
 */
private Button createGoToEndButton() {
	final Button b = new Button(this);
	b.setText("Go to end");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			final int endIndex = getTestView().getItems().size() - 1;
			getTestView().showItem(endIndex);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:21,代码来源:BodyViewTestHarness.java

示例2: createIncreaseColumnCountButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to increase the number of columns displayed in the test
 * view.
 *
 * @return the button, not null
 */
private Button createIncreaseColumnCountButton() {
	final Button b = new Button(this);
	b.setText("Inc. col count");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			final int currentCount = getTestView().getNumberOfColumns();
			getTestView().setNumberOfColumns(currentCount + 1);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:22,代码来源:GridBodyTestHarness.java

示例3: createDecreaseColumnCountButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to decrease the number of columns displayed in the test
 * view.
 *
 * @return the button, not null
 */
private Button createDecreaseColumnCountButton() {
	final Button b = new Button(this);
	b.setText("Dec. col count");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			final int currentCount = getTestView().getNumberOfColumns();
			getTestView().setNumberOfColumns(Math.max(currentCount - 1, 1));
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:22,代码来源:GridBodyTestHarness.java

示例4: createAddItemButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to add an item to the test view.
 *
 * @return the button, not null
 */
private Button createAddItemButton() {
	final Button b = new Button(this);
	b.setText("Add item");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			final LibraryItem newItem = new NormalLibraryItem(getResources(),
					"Title " + items.size(),
					"Subtitle " + items.size(),
					ARTWORK_RES_ID);

			items.add(0, newItem);
			getTestView().notifyItemAdded(0);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:26,代码来源:BodyViewTestHarness.java

示例5: createMoveItemButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to swap the first two items in the test view.
 *
 * @return the button, not null
 */
private Button createMoveItemButton() {
	final Button b = new Button(this);
	b.setText("Swap first two items");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			if (items.size() > 1) {
				final LibraryItem item = items.get(0);
				items.remove(0);
				items.add(1, item);

				getTestView().notifyItemMoved(0, 1);
			}
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:26,代码来源:BodyViewTestHarness.java

示例6: createDecreaseFadeDurationButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to decrease the artwork fade duration of the test view.
 * The duration is decreased by 25 millisecond per click.
 *
 * @return the button, not null
 */
private Button createDecreaseFadeDurationButton() {
	final Button b = new Button(this);
	b.setText("Dec. fade time");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			final ArtworkBinder artworkBinder = (ArtworkBinder) getTestView()
					.getArtworkDataBinder();

			if (artworkBinder != null) {
				final int currentDuration = artworkBinder.getFadeInDurationMs();
				artworkBinder.setFadeInDurationMs(Math.max(currentDuration - 25, 0));
			}
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:27,代码来源:RecyclerViewBodyTestHarness.java

示例7: createUseListBodyButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to set the body of the test view to a new {@link
 * ListBody}.
 *
 * @return the button, not null
 */
private Button createUseListBodyButton() {
	final Button b = new Button(this);
	b.setText("Use list body");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			final ListBody body = new ListBody(CoordinatedMixtapeContainerTestHarness.this);

			body.setItems(bodyItems);
			body.setTitleDataBinder(new TitleBinder(titleCache, defaults));
			body.setSubtitleDataBinder(new SubtitleBinder(subtitleCache, defaults));
			body.setArtworkDataBinder(new ArtworkBinder(artworkCache, defaults));

			testView.setBody(body);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:28,代码来源:CoordinatedMixtapeContainerTestHarness.java

示例8: addButton

import android.widget.Button; //导入方法依赖的package包/类
private void addButton(final DemoInfo leaf){
	Button btn = new Button(getActivity());
	btn.setText(leaf.name);
	btn.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
	btn.setBackgroundResource(R.drawable.sel_menu3);
	btn.setTextSize(15);
	btn.setPadding(20, 0, 20, 0);
	btn.setTextColor(Color.WHITE);
	btn.setAllCaps(false);


	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, Utils.dip2px(getActivity(), 40));
	lp.gravity = Gravity.CENTER;
	lp.topMargin = Utils.dip2px(getActivity(), 5);
	lp.bottomMargin = Utils.dip2px(getActivity(), 5);
	lp.leftMargin = Utils.dip2px(getActivity(), 5);
	lp.rightMargin = Utils.dip2px(getActivity(), 5);
	ll_root.addView(btn, lp);

	btn.setOnClickListener(new View.OnClickListener() {

		@Override
		public void onClick(View v) {
			if(leaf.onClickListener == null){
				Toast.makeText(getActivity(), "sorry,此功能尚未实现", Toast.LENGTH_SHORT).show();
			}else{
				leaf.onClickListener.onClick(v);
			}
		}
	});

}
 
开发者ID:cowthan,项目名称:ayo-menu,代码行数:33,代码来源:DemoMenuActivityAttacher.java

示例9: createChangeTitleBinderButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to change the title binder of the test view.
 *
 * @return the button, not null
 */
private Button createChangeTitleBinderButton() {
	final Button b = new Button(this);
	b.setText("Change title binder");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			getTestView().setTitleDataBinder(new TitleBinder(titleCache, defaults));
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:20,代码来源:ToolbarHeaderTestHarness.java

示例10: createShowHeaderAlwaysButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to configure the test view to always show the header.
 *
 * @return the button, not null
 */
private Button createShowHeaderAlwaysButton() {
	final Button b = new Button(this);
	b.setText("Show header always");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			testView.showHeaderAlways();
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:20,代码来源:CoordinatedMixtapeContainerTestHarness.java

示例11: createSetItemsButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to display the items in the test view.
 *
 * @return the button, not null
 */
private Button createSetItemsButton() {
	final Button b = new Button(this);
	b.setText("Set items");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			items.clear();

			for (int i = 0; i < NUMBER_OF_ITEMS; i++) {
				if (new Random().nextBoolean()) {
					items.add(new NormalLibraryItem(getResources(),
							"Title " + i,
							"Subtitle " + i,
							ARTWORK_RES_ID));
				} else {
					items.add(new InaccessibleLibraryItem());
				}
			}

			getTestView().setItems(items);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:33,代码来源:BodyViewTestHarness.java

示例12: createUseNullBodyButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to clear the test view body.
 *
 * @return the button, not null
 */
private Button createUseNullBodyButton() {
	final Button b = new Button(this);
	b.setText("Clear body");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			testView.setBody(null);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:20,代码来源:CoordinatedMixtapeContainerTestHarness.java

示例13: createGoToTopButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to go to the top of the test view.
 *
 * @return the button, not null
 */
private Button createGoToTopButton() {
	final Button b = new Button(this);
	b.setText("Go to top");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			getTestView().showItem(0);
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:20,代码来源:BodyViewTestHarness.java

示例14: createChangeSubtitleBinderButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to change the subtitle binder of the test view.
 *
 * @return the button, not null
 */
private Button createChangeSubtitleBinderButton() {
	final Button b = new Button(this);
	b.setText("Change subtitle binder");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			getTestView().setSubtitleDataBinder(new SubtitleBinder(subtitleCache, defaults));
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:20,代码来源:ToolbarHeaderTestHarness.java

示例15: createToggleLoadingIndicatorVisibilityButton

import android.widget.Button; //导入方法依赖的package包/类
/**
 * Creates a button which can be clicked to toggle the visibility of the loading indicator in
 * the test view.
 *
 * @return the button, not null
 */
private Button createToggleLoadingIndicatorVisibilityButton() {
	final Button b = new Button(this);
	b.setText("Show/hide loading indicator");
	b.setAllCaps(false);

	b.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(final View v) {
			getTestView().showLoadingIndicator(!getTestView().loadingIndicatorIsShown());
		}
	});

	return b;
}
 
开发者ID:MatthewTamlin,项目名称:Mixtape,代码行数:21,代码来源:BodyViewTestHarness.java


注:本文中的android.widget.Button.setAllCaps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。