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


Java RangeBar类代码示例

本文整理汇总了Java中com.edmodo.rangebar.RangeBar的典型用法代码示例。如果您正苦于以下问题:Java RangeBar类的具体用法?Java RangeBar怎么用?Java RangeBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: changePeriod

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
private void changePeriod(Period newPeriod) {
	bitmaps.clear();
	
	load_period = newPeriod;
	
	adapter.refreshAll();

	if (isDynazoomOpen()) {
		dynazoom_from = DynazoomHelper.getFromPinPoint(load_period);
		dynazoom_to = DynazoomHelper.getToPinPoint();

		dynazoomFetcher = (DynazoomFetcher) new DynazoomFetcher(currentPlugin, (ImageView) findViewById(R.id.dynazoom_imageview),
				(ProgressBar) findViewById(R.id.dynazoom_progressbar), context, muninFoo.getUserAgent(),
				dynazoom_from, dynazoom_to).execute();
		dynazoom_updateFromTo();
		((RangeBar) findViewById(R.id.dynazoom_rangebar)).setThumbIndices(0, DynazoomHelper.RANGEBAR_TICKS_COUNT - 1);
	}
	
	item_period.setTitle(load_period.getLabel(context).toUpperCase());
}
 
开发者ID:chteuchteu,项目名称:Munin-for-Android,代码行数:21,代码来源:Activity_GraphView.java

示例2: updateHighlightedArea

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
public static void updateHighlightedArea(View highlightArea1, View highlightArea2, RangeBar rangeBar, ImageView imageView) {
	int[] steps = { rangeBar.getLeftIndex(),  rangeBar.getRightIndex() };
	int[] highlightedAreaX1 = getHighlightedAreaFromSteps(steps, RANGEBAR_TICKS_COUNT, imageView.getWidth(), 1);
	int[] highlightedAreaX2 = getHighlightedAreaFromSteps(steps, RANGEBAR_TICKS_COUNT, imageView.getWidth(), 2);

	// If we try to get the imageView position, we'll only get top=0, height=(full screen) since
	// the imageView layout_width && layout_height == MATCH_PARENT
	int[] bitmapPosition = Util.getBitmapPositionInsideImageView(imageView);

	int left, top, width, height;

	top = bitmapPosition[1] + GRAPH_TOP_MARGIN;
	height = bitmapPosition[3] - (GRAPH_TOP_MARGIN + GRAPH_BOTTOM_MARGIN);

	// Left mask
	left = highlightedAreaX1[0];
	width = highlightedAreaX1[1] - highlightedAreaX1[0];
	setLayoutParams(highlightArea1, width, height, left, top);

	// Right mask
	left = highlightedAreaX2[0];
	width = highlightedAreaX2[1] - highlightedAreaX2[0];
	setLayoutParams(highlightArea2, width, height, left, top);
}
 
开发者ID:chteuchteu,项目名称:Munin-for-Android,代码行数:25,代码来源:DynazoomHelper.java

示例3: onRestoreInstanceState

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
@Override
protected void onRestoreInstanceState(Bundle bundle) {
    super.onRestoreInstanceState(bundle);
    mBarColor = bundle.getInt("BAR_COLOR");
    mConnectingLineColor = bundle.getInt("CONNECTING_LINE_COLOR");
    mThumbColorNormal = bundle.getInt("THUMB_COLOR_NORMAL");
    mThumbColorPressed = bundle.getInt("THUMB_COLOR_PRESSED");

    // Change the text colors to the appropriate colors, and the text as
    // well
    colorChanged(Component.BAR_COLOR, mBarColor);
    colorChanged(Component.CONNECTING_LINE_COLOR, mConnectingLineColor);
    colorChanged(Component.THUMB_COLOR_NORMAL, mThumbColorNormal);
    colorChanged(Component.THUMB_COLOR_PRESSED, mThumbColorPressed);

    // Gets the RangeBar
    rangebar = (RangeBar) findViewById(R.id.rangebar1);

    // Gets the index value TextViews
    final TextView leftIndexValue = (TextView) findViewById(R.id.leftIndexValue);
    final TextView rightIndexValue = (TextView) findViewById(R.id.rightIndexValue);
    // Resets the index values every time the activity is changed
    leftIndexValue.setText("" + rangebar.getLeftIndex());
    rightIndexValue.setText("" + rangebar.getRightIndex());

    // Sets focus to the main layout, not the index text fields
    findViewById(R.id.mylayout).requestFocus();

}
 
开发者ID:erkutaras,项目名称:ultimate-rangebar,代码行数:30,代码来源:MainActivity.java

示例4: loadUiResources

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
private void loadUiResources()
{
	textView_soundTitle = (TextView) findViewById(R.id.textView_soundTitle);
	textView_soundArtist = (TextView) findViewById(R.id.textView_soundArtist);
	textView_soundStart = (TextView) findViewById(R.id.textView_startTime);
	textView_soundEnd = (TextView) findViewById(R.id.textView_endTime);
	textView_currentPosition = (TextView) findViewById(R.id.textView_currentPosition);
	rangeBar_soundSelector = (RangeBar) findViewById(R.id.rangebar_audiosection);
	button_play_pause = (ImageButton) findViewById(R.id.button_play_pause);
	button_stop = (ImageButton) findViewById(R.id.button_stop);
}
 
开发者ID:AlphaBetaPeter,项目名称:alarming,代码行数:12,代码来源:AlarmSoundEditActivity.java

示例5: setUpRangeBar

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
private void setUpRangeBar()
{
	Log.d(DEBUG_TAG, "Setting up RangeBar.");
	int tickCount = mSoundMillis / 1000;
	if (tickCount < 2)
	{
		tickCount = 2;
	}
	int left = mStartMillis / 1000;
	int right = mEndMillis / 1000;
	if (left <= 0)
	{
		left = 0;
	}
	if (right >= tickCount - 1)
	{
		right = tickCount - 1;
	}
	rangeBar_soundSelector.setTickCount(tickCount);
	rangeBar_soundSelector.setThumbIndices(left, right);
	rangeBar_soundSelector.setLeft(left);
	rangeBar_soundSelector.setRight(right);
	rangeBar_soundSelector.setOnRangeBarChangeListener(new RangeBar.OnRangeBarChangeListener()
	{
		@Override
		public void onIndexChangeListener(
				RangeBar rangeBar, int leftThumbSec, int rightThumbSec)
		{
			mStartMillis = leftThumbSec * 1000;
			mEndMillis = rightThumbSec * 1000;
			textView_soundStart.setText(StringUtil.getTimeFormattedFromSeconds(leftThumbSec));
			textView_soundEnd.setText(StringUtil.getTimeFormattedFromSeconds(rightThumbSec));
			textView_currentPosition.setText(
					StringUtil.getTimeFormattedFromSeconds(leftThumbSec));
		}
	});
}
 
开发者ID:AlphaBetaPeter,项目名称:alarming,代码行数:38,代码来源:AlarmSoundEditActivity.java

示例6: onPrepareDialogBuilder

import com.edmodo.rangebar.RangeBar; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
    super.onPrepareDialogBuilder(builder);

    final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext());
    final View view = View.inflate(getContext(), R.layout.rangebar_preference, null);
    final RangeBar rangebar = (RangeBar) view.findViewById(R.id.rangebar);

    rangebar.setTickCount(max - min + 1);
    rangebar.setOnRangeBarChangeListener(new RangeBar.OnRangeBarChangeListener() {
        private TextView rangetext = (TextView) view.findViewById(R.id.rangetext);

        @Override
        public void onIndexChangeListener(RangeBar rangeBar, int left, int right) {
            if (left < min || left > max) {
                rangeBar.setLeft(min); return;
            }

            if (right < min || right > max) {
                rangeBar.setRight(max); return;
            }

            rangetext.setText("" + (left + min) + " - " + (right + min));
        }
    });

    int current_min = Util.getIntPreference(getContext(), key_min, defaultMin);
    if (current_min < min)
        current_min = min;

    int current_max = Util.getIntPreference(getContext(), key_max, defaultMax);
    if (current_max > max)
        current_max = max;

    rangebar.setThumbIndices(current_min, current_max);

    builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            settings.edit()
                    .putInt(key_min, rangebar.getLeftIndex() + min)
                    .putInt(key_max, rangebar.getRightIndex() + min)
                    .apply();
        }
    });

    builder.setView(view);
}
 
开发者ID:mosmetro-android,项目名称:mosmetro-android,代码行数:49,代码来源:RangeBarPreference.java


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