本文整理汇总了Java中android.view.View.setOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java View.setOrientation方法的具体用法?Java View.setOrientation怎么用?Java View.setOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setOrientation方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.view.View; //导入方法依赖的package包/类
protected final void onCreate(Bundle bundle) {
super.onCreate(bundle);
Context context = getContext();
View linearLayout = new LinearLayout(context);
LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
layoutParams.gravity = 17;
linearLayout.setOrientation(0);
linearLayout.setLayoutParams(layoutParams);
Drawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(-450944201);
gradientDrawable.setCornerRadius((float) a(context, 5.0f));
linearLayout.setBackgroundDrawable(gradientDrawable);
View imageView = new ImageView(context);
layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
layoutParams.gravity = 16;
layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
imageView.setLayoutParams(layoutParams);
imageView.setScaleType(ScaleType.FIT_CENTER);
imageView.setImageDrawable(a(context, a.d));
Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
rotateAnimation.setRepeatCount(-1);
rotateAnimation.setDuration(900);
rotateAnimation.setInterpolator(new LinearInterpolator());
imageView.startAnimation(rotateAnimation);
View textView = new TextView(context);
textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
textView.setTextSize(16.0f);
textView.setTextColor(-1);
layoutParams = new LinearLayout.LayoutParams(-2, -2);
layoutParams.gravity = 16;
layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
textView.setLayoutParams(layoutParams);
linearLayout.addView(imageView);
linearLayout.addView(textView);
setContentView(linearLayout);
setCancelable(false);
}
示例2: a
import android.view.View; //导入方法依赖的package包/类
private View a(Context context) {
View linearLayout = new LinearLayout(context);
LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
layoutParams.gravity = 17;
linearLayout.setOrientation(0);
linearLayout.setLayoutParams(layoutParams);
Drawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(-450944201);
gradientDrawable.setCornerRadius((float) a(context, 5.0f));
linearLayout.setBackgroundDrawable(gradientDrawable);
View imageView = new ImageView(context);
layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
layoutParams.gravity = 16;
layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
imageView.setLayoutParams(layoutParams);
imageView.setScaleType(ScaleType.FIT_CENTER);
imageView.setImageDrawable(a(context, a.d));
Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
rotateAnimation.setRepeatCount(-1);
rotateAnimation.setDuration(900);
rotateAnimation.setInterpolator(new LinearInterpolator());
imageView.startAnimation(rotateAnimation);
View textView = new TextView(context);
textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
textView.setTextSize(16.0f);
textView.setTextColor(-1);
layoutParams = new LinearLayout.LayoutParams(-2, -2);
layoutParams.gravity = 16;
layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
textView.setLayoutParams(layoutParams);
linearLayout.addView(imageView);
linearLayout.addView(textView);
return linearLayout;
}
示例3: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
String string = extras.getString("url");
if (k.a(string)) {
Method method;
super.requestWindowFeature(1);
this.c = new Handler(getMainLooper());
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.a = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.a.setVisibility(0);
linearLayout.addView(this.a, layoutParams);
WebSettings settings = this.a.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.a.setVerticalScrollbarOverlay(true);
this.a.setWebViewClient(new a());
this.a.setDownloadListener(new a(this));
this.a.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}
示例4: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
String string = extras.getString("url");
if (k.a(string)) {
Method method;
super.requestWindowFeature(1);
this.c = new Handler(getMainLooper());
Object string2 = extras.getString("cookie");
if (!TextUtils.isEmpty(string2)) {
CookieSyncManager.createInstance(getApplicationContext()).sync();
CookieManager.getInstance().setCookie(string, string2);
CookieSyncManager.getInstance().sync();
}
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.a = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.a.setVisibility(0);
linearLayout.addView(this.a, layoutParams);
WebSettings settings = this.a.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.a.setVerticalScrollbarOverlay(true);
this.a.setWebViewClient(new a());
this.a.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}
示例5: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
this.d = extras.getString(b);
String string = extras.getString("params");
if (k.a(string)) {
Method method;
super.requestWindowFeature(1);
this.f = new Handler(getMainLooper());
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.c = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.c.setVisibility(0);
linearLayout.addView(this.c, layoutParams);
WebSettings settings = this.c.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + k.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.c.setVerticalScrollbarOverlay(true);
this.c.setWebViewClient(new b());
this.c.setWebChromeClient(new a());
this.c.setDownloadListener(new a(this));
this.c.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.c.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.c.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.c.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.c, new Object[]{"searchBoxJavaBridge_"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}
示例6: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
String string = extras.getString("url");
if (i.b(string)) {
Method method;
super.requestWindowFeature(1);
this.c = new Handler(getMainLooper());
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.a = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.a.setVisibility(0);
linearLayout.addView(this.a, layoutParams);
WebSettings settings = this.a.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.a.setVerticalScrollbarOverlay(true);
this.a.setWebViewClient(new a());
this.a.setDownloadListener(new b(this));
this.a.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
method.invoke(this.a, new Object[]{"accessibility"});
method.invoke(this.a, new Object[]{"accessibilityTraversal"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}
示例7: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
String string = extras.getString("url");
if (i.b(string)) {
Method method;
super.requestWindowFeature(1);
this.c = new Handler(getMainLooper());
Object string2 = extras.getString("cookie");
if (!TextUtils.isEmpty(string2)) {
CookieSyncManager.createInstance(getApplicationContext()).sync();
CookieManager.getInstance().setCookie(string, string2);
CookieSyncManager.getInstance().sync();
}
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.a = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.a.setVisibility(0);
linearLayout.addView(this.a, layoutParams);
WebSettings settings = this.a.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.a.setVerticalScrollbarOverlay(true);
this.a.setWebViewClient(new a());
this.a.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.a.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.a.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.a.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.a, new Object[]{"searchBoxJavaBridge_"});
method.invoke(this.a, new Object[]{"accessibility"});
method.invoke(this.a, new Object[]{"accessibilityTraversal"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}
示例8: onCreate
import android.view.View; //导入方法依赖的package包/类
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
finish();
return;
}
try {
this.d = extras.getString(b);
String string = extras.getString("params");
if (i.b(string)) {
Method method;
super.requestWindowFeature(1);
this.f = new Handler(getMainLooper());
View linearLayout = new LinearLayout(getApplicationContext());
LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
linearLayout.setOrientation(1);
setContentView(linearLayout, layoutParams);
this.c = new WebView(getApplicationContext());
layoutParams.weight = 1.0f;
this.c.setVisibility(0);
linearLayout.addView(this.c, layoutParams);
WebSettings settings = this.c.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + i.c(getApplicationContext()));
settings.setRenderPriority(RenderPriority.HIGH);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptEnabled(true);
settings.setSavePassword(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setMinimumFontSize(settings.getMinimumFontSize() + 8);
settings.setAllowFileAccess(false);
settings.setTextSize(TextSize.NORMAL);
this.c.setVerticalScrollbarOverlay(true);
this.c.setWebViewClient(new b());
this.c.setWebChromeClient(new a());
this.c.setDownloadListener(new a(this));
this.c.loadUrl(string);
if (VERSION.SDK_INT >= 7) {
try {
method = this.c.getSettings().getClass().getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
if (method != null) {
method.invoke(this.c.getSettings(), new Object[]{Boolean.valueOf(true)});
}
} catch (Exception e) {
}
}
try {
method = this.c.getClass().getMethod("removeJavascriptInterface", new Class[0]);
if (method != null) {
method.invoke(this.c, new Object[]{"searchBoxJavaBridge_"});
method.invoke(this.c, new Object[]{"accessibility"});
method.invoke(this.c, new Object[]{"accessibilityTraversal"});
return;
}
return;
} catch (Exception e2) {
return;
}
}
finish();
} catch (Exception e3) {
finish();
}
} catch (Exception e4) {
finish();
}
}