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


Java Crouton.showText方法代码示例

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


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

示例1: onClick

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (v.getId() == R.id.bLoadApk) {
        if(versionUrl == null){
            Crouton.showText(activity, R.string.url_apk_notfound, Style.ALERT);
            return;
        }
        h.setVisible(pbLoaderApk);
        h.setVisibleGone(bLoadApk);

        permission.checkPermission(PermissionSontroller.WRITE_EXTERNAL_STORAGE, new BasePermissionController.OnRequestPermission() {
            @Override
            public void requestDone(boolean allow) {
                if(allow){
                    new UpdateApp(activity)
                            .setProgresListener(AboutFragment.this)
                            .startLoad(versionUrl);
                } else {
                    h.setVisibleGone(pbLoaderApk);
                    h.setVisible(bLoadApk);
                    h.showMsg(activity, R.string.access_sd);
                }
            }
        });
    }
}
 
开发者ID:LeshiyGS,项目名称:shikimori,代码行数:27,代码来源:AboutFragment.java

示例2: aPlusB

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的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.Crouton; //导入方法依赖的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.Crouton; //导入方法依赖的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: onCreate

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
   super.onCreate(icicle);
   setContentView(R.layout.activity_fragment_container);

   if (icicle == null) {
      DemoBaseFragment fragment = GcmDemoFragment.newInstance();
      getSupportFragmentManager().beginTransaction()
            .replace(R.id.demo_fragment_container, fragment).commit();
   }

   final Intent intent = getIntent();
   String msg = intent.getStringExtra(Constants.KEY_MESSAGE_TXT);
   if (msg != null) {
      final NotificationManager manager = 
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      manager.cancel(Constants.NOTIFICATION_NR);
      String msgTxt = getString(R.string.msg_received, msg);
      Crouton.showText(this, msgTxt, Style.INFO);            
   }
}
 
开发者ID:writtmeyer,项目名称:gcm_sample,代码行数:22,代码来源:GCMDemoActivity.java

示例6: sendMessage

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
private void sendMessage() {
   Intent msgIntent = new Intent(getActivity(), GcmIntentService.class);
   msgIntent.setAction(Constants.ACTION_ECHO);
   String msg;
   if (!TextUtils.isEmpty(mTxtMsg.getText())) {
      msg = mTxtMsg.getText().toString();
      mTxtMsg.setText("");
   }
   else {
      msg = getActivity().getString(R.string.no_message);
   }
   String msgTxt = getString(R.string.msg_sent, msg);
   Crouton.showText(getActivity(), msgTxt, Style.INFO);            
   msgIntent.putExtra(Constants.KEY_MESSAGE_TXT, msg);
   getActivity().startService(msgIntent);
}
 
开发者ID:writtmeyer,项目名称:gcm_sample,代码行数:17,代码来源:GcmDemoFragment.java

示例7: display

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
/**
 * Method used to display message in an activity
 *
 * @param pActivity
 *            activity
 * @param msg
 * @param success
 */
public static void display(final Activity pActivity, final CharSequence msg, final CoutonColor coutonColor) {

	int color = 0;
	switch (coutonColor) {
	case GREEN:
		color = pActivity.getResources().getColor(R.color.green_success);
		break;
	case ORANGE:
		color = pActivity.getResources().getColor(R.color.orange);
		break;
	case BLACK:
	default:
		color = pActivity.getResources().getColor(R.color.black_error);
	}

	// Remove all previous crouton
	Crouton.cancelAllCroutons();
	// Build style
	Style style = new Style.Builder().setBackgroundColorValue(color) //
			.setPaddingDimensionResId(R.dimen.crouton_padding) //
			.setGravity(Gravity.CENTER) //
			.setTextAppearance(R.style.Crouton_TextApparence) //
			.build();

	Crouton.showText(pActivity, msg, style, R.id.crouton);
}
 
开发者ID:JackuyLiu,项目名称:Android-NFC-Paycard-Reader,代码行数:35,代码来源:CroutonUtils.java

示例8: launchGooglePlus

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
private void launchGooglePlus() {
    Intent google = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.google_plus_url)));
    if (google.resolveActivity(getPackageManager()) != null) {
        startActivity(google);
    } else {
        Crouton.showText(this, R.string.url_error, Style.ALERT);
    }
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:9,代码来源:ConfigurationActivity.java

示例9: openAccessibility

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
private void openAccessibility() {
    Intent accessibility = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
    try {
        startActivity(accessibility);
    } catch (ActivityNotFoundException e) {
        LOGE(TAG, "Error opening Accessibility.", e);
        Crouton.showText(getActivity(), R.string.accessibility_error, Style.ALERT);
    }
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:10,代码来源:ConfigurationActivity.java

示例10: openNotification

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
private void openNotification() {
    Intent notifications = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
    try {
        startActivity(notifications);
    } catch (ActivityNotFoundException e) {
        LOGE(TAG, "Error opening NotificationListener.", e);
        Crouton.showText(getActivity(), R.string.accessibility_error, Style.ALERT);
    }
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:10,代码来源:ConfigurationActivity.java

示例11: errorEmpty

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
private String errorEmpty() {
    String text = etMessage.getText().toString().trim();
    if (text.length() == 0) {
        Crouton.showText(activity, R.string.set_message, Style.ALERT);
        return null;
    }
    return text;
}
 
开发者ID:LeshiyGS,项目名称:shikimori,代码行数:9,代码来源:DiscusionFragment.java

示例12: aMinusB

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
public void aMinusB(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) {
            Equal_AminusB();
            SetResult();
            ShowResultDialog();
    } else {
        Crouton.showText(this, getString(R.string.crouton_incorrect_dimension), Style.ALERT);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:13,代码来源:MatrixActivity.java

示例13: bMinusA

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
public void bMinusA(View view) {
    CreateA_Array();
    CreateB_Array();
    if (matrix_B_array.length == matrix_A_array.length &&
        matrix_B_array[0].length == matrix_A_array[0].length) {
        Equal_BminusA();
        SetResult();
        ShowResultDialog();
    } else {
        Crouton.showText(this, getString(R.string.crouton_incorrect_dimension), Style.ALERT);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:13,代码来源:MatrixActivity.java

示例14: bTimesA

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
public void bTimesA(View view) {
    CreateA_Array();
    CreateB_Array();
    if (matrix_B_array[0].length == matrix_A_array.length) {
        Equal_BtimesA();
        SetResult();
        ShowResultDialog();
    } else {
        Crouton.showText(this, getString(R.string.crouton_incorrect_dimension), Style.ALERT);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:12,代码来源:MatrixActivity.java

示例15: aTimesA

import de.keyboardsurfer.android.widget.crouton.Crouton; //导入方法依赖的package包/类
public void aTimesA(View view) {
    CreateA_Array();
    if (matrix_A_array[0].length == matrix_A_array.length) {
        Equal_AxA();
        SetResult();
        ShowResultDialog();
    } else {
        Crouton.showText(this, getString(R.string.crouton_incorrect_dimension), Style.ALERT);
    }
}
 
开发者ID:ohmar,项目名称:Matrixulcation,代码行数:11,代码来源:MatrixActivity.java


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