本文整理汇总了Java中net.glxn.qrgen.android.QRCode类的典型用法代码示例。如果您正苦于以下问题:Java QRCode类的具体用法?Java QRCode怎么用?Java QRCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QRCode类属于net.glxn.qrgen.android包,在下文中一共展示了QRCode类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateDialog
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ViewGroup viewGroup = (ViewGroup) getActivity().getLayoutInflater()
.inflate(R.layout.dialog_qrcode, null);
AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
.setView(viewGroup);
Bundle bundle = getArguments();
if (bundle != null) {
String title = bundle.getString("title");
String qrcodeUrl = bundle.getString("qrcodeUrl");
if (!TextUtils.isEmpty(title)) {
builder.setTitle(title);
}
if (!TextUtils.isEmpty(qrcodeUrl)) {
int qrcodeSize = getResources().getDimensionPixelSize(R.dimen.qrcode_size);
QRCode qrCode = QRCode.from(qrcodeUrl).withSize(qrcodeSize, qrcodeSize);
((ImageView) viewGroup.findViewById(R.id.iv_qrcode)).setImageBitmap(qrCode.bitmap());
}
}
return builder.create();
}
开发者ID:homeii,项目名称:GxIconDIY,代码行数:25,代码来源:QrcodeDialog.java
示例2: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
ButterKnife.bind(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
VCard vCard = new VCard();
vCard.setName(firebaseUser.getUid());
qrImageView.setImageBitmap(QRCode.from(vCard.buildString()).bitmap());
databaseReference = FirebaseDatabase.getInstance().getReference();
currentUser = FirebaseAuth.getInstance().getCurrentUser();
sharedPreferences = getSharedPreferences("user", MODE_PRIVATE);
try {
populateProfile();
} catch (Exception e) {
LogHelper.e(TAG, e.toString());
}
}
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:26,代码来源:ProfileActivity.java
示例3: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wifi);
setTitle("WifiCard");
textView = (TextView) findViewById(R.id.wificard);
imageView = (ImageView) findViewById(R.id.qrcode);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
String wifiString = "WIFI:S:Vodafone Wifi32341;T:WPA;P:administrator;;";
WifiCard wifiCard = WifiCardParser.parse(wifiString);
wifiCard.setPassword("administrator2016");
String wifiCardcontent = wifiCard.buildString();
textView.setText(wifiCardcontent);
imageView.setImageBitmap(QRCode.from(wifiCardcontent).bitmap());
}
开发者ID:RurioLuca,项目名称:QrCardParsing,代码行数:22,代码来源:WifiActivity.java
示例4: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView) findViewById(R.id.mecard);
imageView = (ImageView) findViewById(R.id.qrcode);
String meCardString = "MECARD:N:Luca;TEL:+39 3486454313;EMAIL:[email protected];URL:https://github.com/RurioLuca;NOTE:generate MeCard!;BDAY:1989-07-19;ADR:via del corso , Rome , Italy;ORG:your company;";
MeCard meCard = MeCardParser.parse(meCardString);
meCard.setSurname("Rurio");
meCard.setNote("MeCard generate and modified!");
meCard.addTelephone("+39 3476512321");
String meCardcontent = meCard.buildString();
textView.setText(meCardcontent);
imageView.setImageBitmap(QRCode.from(meCardcontent).bitmap());
}
开发者ID:RurioLuca,项目名称:QrCardParsing,代码行数:22,代码来源:MainActivity.java
示例5: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_vcard);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle("VCard");
textView = (TextView) findViewById(R.id.vcard);
imageView = (ImageView) findViewById(R.id.qrcode);
String vCardString = "BEGIN:VCARD\n" +
"N:Luca\n" +
"FN:Rurio Luca\n" +
"ORG:freelancer\n" +
"TITLE:Developer\n" +
"EMAIL:[email protected]\n" +
"URL:https://yoursite.com\n" +
"END:VCARD";
VCard vCard = VCardParser.parse(vCardString);
vCard.setNote("vCard generate and modified!");
vCard.addTelephone("+39 3486454314");
vCard.addTelephone("+39 3486488888");
vCard.addEmail("[email protected]");
String vCardcontent = vCard.buildString();
textView.setText(vCardcontent);
imageView.setImageBitmap(QRCode.from(vCardcontent).bitmap());
}
开发者ID:RurioLuca,项目名称:QrCardParsing,代码行数:32,代码来源:VCardActivty.java
示例6: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
if (toolbar != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setTitle("Detail");
gson = new Gson();
shortUrl.setText(Utils.getGooglShortUrl(getIntent().getStringExtra(Constants.ARG_SHORT_URL)));
longUrl.setText(getIntent().getStringExtra(Constants.ARG_LONG_URL));
timeagoLayout.setTargetDate(getIntent().getStringExtra(Constants.ARG_CREATED_DATE));
Analytics analytics = gson.fromJson(getIntent().getStringExtra(Constants.ARG_ANALYTICS_DATA), Analytics.class);
String shortClicks = analytics.getAllTime().getShortUrlClicks();
String longClicks = analytics.getAllTime().getLongUrlClicks();
clickCount.setText(String.format(getResources().getString(R.string.click_count), shortClicks));
if (shortClicks == null) shortClicks = "0";
if (longClicks == null) longClicks = "0";
qrcodeImage = QRCode.from(shortUrl.getText().toString()).withSize(250, 220).bitmap();
qrcode.setImageBitmap(qrcodeImage);
setupChart(shortClicks, longClicks);
}
开发者ID:jatindhankhar,项目名称:shorl,代码行数:31,代码来源:DetailActivity.java
示例7: showQRCode
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
public void showQRCode(View view){
Dialog qrCodeDialog = new Dialog(this);
qrCodeDialog.getWindow()
.requestFeature(Window.FEATURE_NO_TITLE);
qrCodeDialog.setContentView(getLayoutInflater().inflate(R.layout.qr_popup
, null));
final ImageView qrCodeImageView = (ImageView) qrCodeDialog.findViewById(R.id.qrCodeImageView);
// Generate QR-Code for ShortLink
Bitmap qrCode = QRCode.from(shortUrl)
.withSize(800,800)
.withColor(0xFF000000, 0x00000000)
.bitmap();
// Set QRCode ad Image
qrCodeImageView.setImageBitmap(qrCode);
qrCodeDialog.show();
}
开发者ID:michaelachmann,项目名称:LnkShortener,代码行数:25,代码来源:DisplayShortenedUrlActivity.java
示例8: onCreate
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_vevent);
setTitle("VEVENT");
textView = (TextView) findViewById(R.id.vcard);
imageView = (ImageView) findViewById(R.id.qrcode);
// addToCalendar = (Button) findViewById(R.id.addtocal);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
String vEventString = "BEGIN:VEVENT\n" +
"SUMMARY:Google IO\n" +
"LOCATION:Shoreline Amphitheatre Mountain View, California\n" +
"DTSTART:20170611T130000Z\n" +
"DTEND:20170611T153400Z\n" +
"END:VEVENT";
final VEvent vEvent = VEventParser.parse(vEventString);
vEvent.setSummary("Google I/O");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(VEventCostant.DATE_FORMAT);
try {
Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(vEvent.getDtEnd()));
calendar.set(Calendar.DAY_OF_MONTH, 12);
calendar.set(Calendar.HOUR_OF_DAY, 14);
calendar.set(Calendar.MINUTE, 00);
vEvent.setDtEnd(simpleDateFormat.format(calendar.getTime()));
} catch (ParseException e) {
e.printStackTrace();
}
String vEventcontent = vEvent.buildString();
textView.setText(vEventcontent);
imageView.setImageBitmap(QRCode.from(vEventcontent).bitmap());
/* addToCalendar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
vEvent.addToCalendar(VEventActivity.this);
}
});
*/
}
开发者ID:RurioLuca,项目名称:QrCardParsing,代码行数:45,代码来源:VEventActivity.java
示例9: generateQrCode
import net.glxn.qrgen.android.QRCode; //导入依赖的package包/类
private void generateQrCode(String ipAddress) {
Bitmap qrCOde = QRCode.from(ipAddress).bitmap();
getView().setQrCodeBitmap(qrCOde);
}
开发者ID:hypeapps,项目名称:Endoscope,代码行数:5,代码来源:QrCodePresenter.java
注:本文中的net.glxn.qrgen.android.QRCode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论