目标:
创建可绘制和可缩放的imageview,
这意味着当我按下按钮时,它是可绘制的,
或者当我关闭时,这是可缩放的.
*请注意,图纸应与图像视图一起变焦
================================================== =============
最近我写了一个像这样的自定义可绘制图像视图:
public class DrawView extends ImageView {
private int color = Color.BLACK;
private float width = 4f;
private List<Holder> holderList = new ArrayList<Holder>();
private class Holder {
Path path;
Paint paint;
Holder(int color, float width) {
path = new Path();
paint = new Paint();
paint.setAntiAlias(true);
paint.setStrokeWidth(width);
paint.setColor(color);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
}
}
public DrawView(Context context) {
super(context);
init();
}
public DrawView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public DrawView(Context context, AttributeSet …Run Code Online (Sandbox Code Playgroud) android android-imageview android-canvas android-view android-drawable
目前,我有一个PDF url,我想简单地使用意向来打开它,但是,如果我把它不起作用url在intent
我的代码是这样的,它总是抛出 ActivityNotFoundException 错误
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(law.url), "application/pdf");
try {
startActivity(intent);
} catch (ActivityNotFoundException e){
Utility.showErrorDialog(
ctx,ctx.getResources().getString(R.string.sys_in,
ctx.getResources().getString(R.string.err_no_pdf_reader),
ctx.getResources().getString(R.string.close));
}
Run Code Online (Sandbox Code Playgroud)
我也尝试了goolge doc方法,但是我的客户拒绝了这个,所以我没有使用这种方法
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("http://docs.google.com/viewer?url="
+ publish.get(Integer.parseInt((String) view.getTag())).pdfURL), "text/html");
ctx.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
感谢帮助
Log cat错误更新
04-23 18:18:50.487: E/AndroidRuntime(17161): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://oshc.zizsoft.com/oshc_testing.pdf typ=application/pdf }
04-23 18:18:50.487: E/AndroidRuntime(17161): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1568)
04-23 18:18:50.487: E/AndroidRuntime(17161): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1439)
04-23 18:18:50.487: E/AndroidRuntime(17161): at android.app.Activity.startActivityForResult(Activity.java:3356)
04-23 18:18:50.487: E/AndroidRuntime(17161): at android.app.Activity.startActivityForResult(Activity.java:3317)
04-23 …Run Code Online (Sandbox Code Playgroud) 连接沙盒paypal的网站工作,直到最近
它可以连接将卷曲
但是当它第二次发送请求时
它显示了错误
错误:14077410:SSL例程:SSL23_GET_SERVER_HELLO:sslv3警报握手失败
我已经尝试了一些在线参考并设置它的SSL SHA-256证书,但它返回相同的错误.其他建议在卷曲连接处切换到TLS,但由于我处理的项目很多,因此可能无法实现.
是否有任何建议将沙盒paypal与SSLv3连接?谢谢你的帮助.
我有一封如下的电子邮件.问题是,它在Gmail上运行正常,但在outlook上,所有CSS内联语句都不起作用.
一个例子是:
<a href="https://www.facebook.com/BePureApparel" target="_blank"><img style="width: 35px;" src="{img_dir}fb.png" /></a>
//The image width is stripped out and the original size is used to display
Run Code Online (Sandbox Code Playgroud)
这有什么问题吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Welcome to Pure Apparel</title>
</head>
<body>
<table class="table table-mail" style="width: 100%; margin-top: 10px; -moz-box-shadow: 0 0 5px #afafaf; -webkit-box-shadow: 0 0 5px #afafaf; -o-box-shadow: 0 0 5px #afafaf; box-shadow: 0 0 5px #afafaf; filter: progid:DXImageTransform.Microsoft.Shadow(color=#afafaf,Direction=134,Strength=5);">
<tbody>
<tr>
<td class="space" style="width: 20px; padding: 7px …Run Code Online (Sandbox Code Playgroud) 我在本教程中实现了reCAPTCHA,
https://codeforgeek.com/2014/12/google-recaptcha-tutorial/
这是第一次运作良好提交.我遇到的问题是:
我发送验证码与其他表格数据,如用户名,电子邮件等....所以如果验证码是正确的但其他不是,用户将再次发送它,但第二次它返回"{"成功":false}"
如果我闲置它约2分钟,它将会话到期,如果我选择该框,它会弹出警告并发出警告,例如"无法刷新:无效参数",我无法再次选择该框
如何解决这些问题?非常感谢.
我正在使用perstashop(一个开源的Eshop框架)paypal插件来实现paypal功能.
实际上它是PHP框架,所以它应该类似于其他网站实现.
我想更改结帐页面的语言
以下是代码:
<form id="paypal_payment_form" action="{$base_dir_ssl}modules/paypal/express_checkout/payment.php" data-ajax="false" title="{l s='Pay with PayPal' mod='paypal'}" method="post">
<input type="hidden" name="express_checkout" value="{$PayPal_payment_type|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="current_shop_url" value="{$PayPal_current_page|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="bn" value="{$PayPal_tracking_code|escape:'htmlall':'UTF-8'}" />
</form>
Run Code Online (Sandbox Code Playgroud)
有人说放线
<input type="hidden" name="lc" value="xx_XX">
Run Code Online (Sandbox Code Playgroud)
在表单中,我检查支持区域设置代码列表并把它,不幸的是它保持不变
所以我想知道:
1)这是正确的还是我需要改变其他地方?
2)PayPal语言在paypal面板而不是代码中改变了吗?有一个默认语言设置,但我怎样才能根据Eshop语言进行动态更改?
3)我也可以控制语言选择吗?我的eshop有英语,法国和德国,但paypal结帐只能在英语和法国之间改变,有什么想法吗?
这是经典的快速结账页面.
谢谢你的帮助.
更新:
发现语言是由送货地址控制的.那意味着我可以以某种方式改变它
There is a plugin that need to config the composer
First , I need to run:
https://github.com/thephpleague/omnipay
composer require omnipay/paypal:~2.0
Run Code Online (Sandbox Code Playgroud)
So, I have type in the above command in xampp shell, it works, and a composer.json , vendor folder is created in xampp root folder.
第一步是成功.其次,我需要配置
https://github.com/lokielse/omnipay-alipay
我已将composer.json编辑为:
{
"require": {
"lokielse/omnipay-alipay": "dev-master"
}
}
Run Code Online (Sandbox Code Playgroud)
但问题是我似乎无法在xampp shell中运行以下命令.它只显示$不是命令.那么,我该如何执行呢?非常感谢
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Run Code Online (Sandbox Code Playgroud) 使用此网络库:
由于目前的状态是开发,我想使用自签名SSL证书
图书馆论坛有一些讨论:
https://github.com/koush/ion/issues/3
Ion ion = Ion.getDefault(c);
ion.configure().createSSLContext("TLS");
ion.getHttpClient().getSSLSocketMiddleware().setSSLContext(sslContext);
ion.getHttpClient().getSSLSocketMiddleware().setTrustManagers(trustManagers);
Run Code Online (Sandbox Code Playgroud)
经过一些研究,我抓住了crt并获得了sslContext和trustmanager,问题是,它仍然返回异常
javax.net.ssl.SSLException
Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Run Code Online (Sandbox Code Playgroud)
这是我的尝试:
try {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream caInput = getResources().openRawResource(R.raw.load);
Certificate ca;
try {
ca = cf.generateCertificate(caInput);
//System.out.println("ca=" + ((X509Certificate) ca).getSubjectDN());
} finally {
caInput.close();
}
String keyStoreType = KeyStore.getDefaultType();
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
keyStore.load(null, null);
keyStore.setCertificateEntry("ca", ca);
String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
tmf = TrustManagerFactory.getInstance(tmfAlgorithm);
tmf.init(keyStore);
ssl_context = SSLContext.getInstance("TLS");
ssl_context.init(null, tmf.getTrustManagers(), null);
} catch (Exception …Run Code Online (Sandbox Code Playgroud) 我正在使用codeigniter,语言由会话决定.
我写了元数据,facebook/twitter抓取数据并共享页面:
echo "<meta name='twitter:card' content='summary' />";
echo "<meta property='og:title' content='" . $video->{set_lang("title")} . "' />";
echo "<meta property='og:description' content='" . $video->{set_lang("description")} . "' />";
echo "<meta property='og:image' content='" . (isset($video->image_url) ? site_url("thumbnail/" . $video->image_url) : $video->thumbnail) . "' />";
Run Code Online (Sandbox Code Playgroud)
set_lang函数用于检查会话,如下所示:
function set_lang($var) {
$CI = & get_instance();
$lang = $CI->session->userdata('site_lang');
if ($lang == "english") {
return $var;
} else if ($lang == "zh_tw") {
return $var . "_tw";
} else if ($lang == "zh_cn") {
return $var . "_cn"; …Run Code Online (Sandbox Code Playgroud) 我想达到这样的效果:
当您单击文档/教程/支持时,菜单将转到子级菜单.它不是可扩展的列表视图,也不是父菜单标题下的子菜单项.
我尝试使用导航视图创建菜单,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_home"
android:icon="@drawable/ic_event"
android:title="Home" />
<item
android:id="@+id/nav_profile"
android:icon="@drawable/ic_dashboard"
android:title="Perfil" />
</group>
<item android:title="More Options">
<menu>
<item
android:icon="@drawable/ic_forum"
android:title="Forum" />
<item
android:icon="@drawable/ic_headset"
android:title="Headset" />
</menu>
</item>
</menu>
Run Code Online (Sandbox Code Playgroud)
问题是,当我点击父菜单标题时,它不会转到子级.如何在android中实现?非常感谢
php ×5
android ×4
curl ×2
html ×2
paypal ×2
ssl ×2
android-ion ×1
android-menu ×1
android-view ×1
captcha ×1
codeigniter ×1
css ×1
email ×1
facebook ×1
https ×1
javascript ×1
jquery ×1
json ×1
menu ×1
navigation ×1
omnipay ×1
outlook ×1
pdf ×1
sandbox ×1
self-signed ×1
share ×1
shell ×1
twitter ×1