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


Java Configuration类代码示例

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


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

示例1: enableLocationCapture

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void enableLocationCapture(int action){
    expectingLocation = true;
    expectingAction = action;

    int msg_res;
    switch (action) {
        case ACTION_NEW_PIN:  msg_res = R.string.tap_to_pin;
            break;
        case ACTION_GET_ORIGIN:  msg_res = R.string.tap_origin;
            break;
        case ACTION_GET_DESTINATION:  msg_res = R.string.tap_destination;
            break;
        default: msg_res = R.string.error;
            break;
    }

    final Crouton crouton = Crouton.makeText(this, msg_res, new Style.Builder()
            .setBackgroundColorValue(getResources().getColor(R.color.purple)).setHeight(getActionbarHeight()).build(),
            (RelativeLayout)findViewById(R.id.root_layout))
            .setConfiguration(new Configuration.Builder().setDuration(Configuration.DURATION_INFINITE).build());

    crouton.show();
}
 
开发者ID:dklisiaris,项目名称:geopin,代码行数:24,代码来源:MainMapActivity.java

示例2: aPlusB

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
/**
 * Set up for "Incorrect Dimensions" Crouton
 *
 **/

public void aPlusB(View view) {
    CreateA_Array();
    CreateB_Array();

    if (matrix_A_array.length == matrix_B_array.length &&
        matrix_A_array[0].length == matrix_B_array[0].length) {
        if (dimension_good) Equal_AplusB();
        if (dimension_good) SetResult();
        if (dimension_good) ShowResultDialog();

    } else {

        Configuration croutonConfiguration = new Configuration.Builder().setDuration(700).build();
        Style croutonStyle = new Style.Builder()
                .setConfiguration(croutonConfiguration)
                .setBackgroundColorValue(getResources().getColor(R.color.crouton_color))
                .build();
        String croutonText = getString(R.string.crouton_incorrect_dimension);

        Crouton.showText(this, croutonText, croutonStyle);
        // Crouton.showText(this, getString(R.string.crouton_incorrect_dimension), Style.ALERT);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:29,代码来源:MatrixActivity.java

示例3: aTimesB

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void aTimesB(View view) {
    CreateA_Array();
    CreateB_Array();
    if (matrix_A_array[0].length == matrix_B_array.length) {
        Equal_AxB();
        SetResult();
        ShowResultDialog();
    } else {
        Configuration croutonConfiguration = new Configuration.Builder().setDuration(700).build();
        Style croutonStyle = new Style.Builder()
                .setConfiguration(croutonConfiguration)
                .setBackgroundColorValue(getResources().getColor(R.color.crouton_color))
                .build();
        String croutonText = getString(R.string.crouton_incorrect_dimension);
        Crouton.showText(this, croutonText, croutonStyle);        }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:17,代码来源:MatrixActivity.java

示例4: transposeB

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void transposeB(View view) {
    CreateB_Array();
    if (matrix_B_array.length < matrix_B_array[0].length ||
        matrix_B_array.length > matrix_B_array[0].length ||
        matrix_B_array.length == matrix_B_array[0].length) {
            Transpose_B();
            SetResult();
            ShowResultDialog();
    } else {
        Configuration croutonConfiguration = new Configuration.Builder().setDuration(700).build();
        Style croutonStyle = new Style.Builder()
                .setConfiguration(croutonConfiguration)
                .setBackgroundColorValue(getResources().getColor(R.color.crouton_color))
                .build();
        String croutonText = getString(R.string.crouton_incorrect_dimension);
        Crouton.showText(this, croutonText, croutonStyle);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:19,代码来源:MatrixActivity.java

示例5: getStyle

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
private Style getStyle() {
    Configuration.Builder conf = new Configuration.Builder();
    conf.setDuration(DURATION);
    Style.Builder style = new Style.Builder();
    style.setConfiguration(conf.build());
    switch (type) {
        case INFO: {
            style.setBackgroundColorValue(Style.holoBlueLight);
            break;
        }
        case ALERT: {
            style.setBackgroundColorValue(Style.holoRedLight);
            break;
        }
    }
    return style.build();
}
 
开发者ID:lacolaco,项目名称:SmileEssence,代码行数:18,代码来源:Notificator.java

示例6: customView

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
private void customView() {
    View view = getLayoutInflater().inflate(R.layout.notice_crouton, null);
    ((TextView) view.findViewById(R.id.message))
            .setText("Hello Crouton!! Let's enjoy!!");

    Configuration config = new Configuration.Builder().setDuration(
            Configuration.DURATION_INFINITE).build();

    final Crouton crouton = Crouton.make(this, view);
    crouton.setConfiguration(config);

    view.findViewById(R.id.ok_button).setOnClickListener(
            new OnClickListener() {
                @Override
                public void onClick(View v) {
                    Crouton.hide(crouton);
                }
            });
    crouton.show();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:21,代码来源:CroutonSampleActivity.java

示例7: onResume

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
@Override
protected void onResume() {
	super.onResume();
	preferences = PreferenceManager.getDefaultSharedPreferences(this);
	Crouton.clearCroutonsForActivity(this);
	Configuration CONFIGURATION_INFINITE = new Configuration.Builder()
       .setDuration(Configuration.DURATION_INFINITE)
       .build();
	Crouton crouton = Crouton.makeText(this, R.string.notification_access_warn, Style.ALERT);
	crouton.setConfiguration(CONFIGURATION_INFINITE);
	crouton.setOnClickListener(new OnClickListener(){

		@Override
		public void onClick(View v) {
			if (apiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
				startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
			else
				startActivity(new Intent("android.settings.ACCESSIBILITY_SETTINGS"));
			
		}
		
	});
	if(!service_running)
		crouton.show();
}
 
开发者ID:umanx,项目名称:DashNotifier,代码行数:26,代码来源:AbstractSettings.java

示例8: showPopup

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
/**
 * show popup from top
 */
protected void showPopup() {
    hide();
    initBackPopup();
    hs.setFont(mContext, view);
    crouton = Crouton.make(mContext, view);
    Configuration croutonConfiguration = new Configuration.Builder()
            .setDuration(Configuration.DURATION_INFINITE).build();
    crouton.setConfiguration(croutonConfiguration);
    crouton.show();
    showBackPopup();
}
 
开发者ID:LeshiyGS,项目名称:shikimori,代码行数:15,代码来源:BasePopup.java

示例9: croutonTest

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void croutonTest(View view) {
    Configuration croutonConfiguration = new Configuration.Builder().setDuration(700).build();
    Style croutonStyle = new Style.Builder()
            .setConfiguration(croutonConfiguration)
            .setBackgroundColorValue(getResources().getColor(R.color.crouton_color))
            .build();

    String croutonText = getString(R.string.crouton_incorrect_dimension);

    Crouton.showText(this, croutonText, croutonStyle);

}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:13,代码来源:MatrixActivity.java

示例10: makeCroutonInfinity

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public static void makeCroutonInfinity(Activity activity, CharSequence msg) {
	final Crouton c = Crouton.makeText(activity,  msg, Style.ALERT)
			.setConfiguration(new Configuration.Builder().setDuration(Configuration.DURATION_INFINITE).build());
			c.setOnClickListener(new OnClickListener() {			
				@Override
				public void onClick(View v) {
					c.hide();
				}
			}).show();	
}
 
开发者ID:dakshit,项目名称:upes-academics,代码行数:11,代码来源:Miscellaneous.java

示例11: displayCrouton

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void displayCrouton(String text, int timeMilli, Style style) {
	Style style1;
	if(style.equals(Style.ALERT)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoRedLight).build();
	} else if(style.equals(Style.CONFIRM)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoGreenLight).build();
	} else {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoBlueLight).build();
	}
	Configuration config = new Configuration.Builder().setDuration(timeMilli).build();
	Crouton.makeText(CalendarActivity.this, text, style1).setConfiguration(config).show();
}
 
开发者ID:richard1,项目名称:BCP-Mobile,代码行数:16,代码来源:CalendarActivity.java

示例12: displayCrouton

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void displayCrouton(String text, int timeMilli, Style style) {
	Style style1;
	if(style.equals(Style.ALERT)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoRedLight).build();
	} else if(style.equals(Style.CONFIRM)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoGreenLight).build();
	} else {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoBlueLight).build();
	}
	Configuration config = new Configuration.Builder().setDuration(timeMilli).build();
	Crouton.makeText(AnnouncementsActivity.this, text, style1).setConfiguration(config).show();
}
 
开发者ID:richard1,项目名称:BCP-Mobile,代码行数:16,代码来源:AnnouncementsActivity.java

示例13: displayCrouton

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void displayCrouton(String text, int timeMilli, Style style) {
	Style style1;
	if(style.equals(Style.ALERT)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoRedLight).build();
	} else if(style.equals(Style.CONFIRM)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoGreenLight).build();
	} else {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoBlueLight).build();
	}
	Configuration config = new Configuration.Builder().setDuration(timeMilli).build();
	Crouton.makeText(GradeViewActivity.this, text, style1).setConfiguration(config).show();
}
 
开发者ID:richard1,项目名称:BCP-Mobile,代码行数:16,代码来源:GradeViewActivity.java

示例14: displayCrouton

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void displayCrouton(String text, int timeMilli, Style style) {
	Style style1;
	if(style.equals(Style.ALERT)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoRedLight).build();
	} else if(style.equals(Style.CONFIRM)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoGreenLight).build();
	} else {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoBlueLight).build();
	}
	Configuration config = new Configuration.Builder().setDuration(timeMilli).build();
	Crouton.makeText(NewsRssActivity.this, text, style1).setConfiguration(config).show();
}
 
开发者ID:richard1,项目名称:BCP-Mobile,代码行数:16,代码来源:NewsRssActivity.java

示例15: displayCrouton

import de.keyboardsurfer.android.widget.crouton.Configuration; //导入依赖的package包/类
public void displayCrouton(String text, int timeMilli, Style style) {
	Style style1;
	if(style.equals(Style.ALERT)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoRedLight).build();
	} else if(style.equals(Style.CONFIRM)) {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoGreenLight).build();
	} else {
		style1 = new Style.Builder().setHeight(LayoutParams.WRAP_CONTENT).setGravity(Gravity.CENTER_HORIZONTAL)
				.setTextSize(15).setPaddingInPixels(15).setBackgroundColorValue(Style.holoBlueLight).build();
	}
	Configuration config = new Configuration.Builder().setDuration(timeMilli).build();
	Crouton.makeText(LoginActivity.this, text, style1).setConfiguration(config).show();
}
 
开发者ID:richard1,项目名称:BCP-Mobile,代码行数:16,代码来源:LoginActivity.java


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