本文整理汇总了Java中org.appcelerator.titanium.util.TiRHelper类的典型用法代码示例。如果您正苦于以下问题:Java TiRHelper类的具体用法?Java TiRHelper怎么用?Java TiRHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TiRHelper类属于org.appcelerator.titanium.util包,在下文中一共展示了TiRHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupIds
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
private void setupIds() {
try {
frame_layout = TiRHelper.getResource("layout.container");
frame_layout_id = TiRHelper.getResource("id.container");
image_view_layout = TiRHelper.getResource("layout.image_viewer");
image_view_container = TiRHelper.getResource("id.image_container");
image_id = TiRHelper.getResource("id.photo_gallery_image_view");
title_id = TiRHelper.getResource("id.imageTitle");
placeholder_image = TiRHelper.getResource("drawable.loading_placeholder");
} catch (ResourceNotFoundException e) {
Log.i(TAG, "XML resources could not be found!!!");
}
}
示例2: getResource
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
private int getResource(String type, String name) {
int icon = 0;
if (name != null) {
/* Remove extension from icon */
int index = name.lastIndexOf(".");
if (index > 0) {
name = name.substring(0, index);
}
try {
icon = TiRHelper.getApplicationResource(type + "." + name);
} catch (TiRHelper.ResourceNotFoundException ex) {
Log.e(LCAT, type + "." + name + " not found; make sure it's in platform/android/res/" + type);
}
}
return icon;
}
示例3: handleHideLogo
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
/**
* Hides the logo
*/
private void handleHideLogo(){
ActionBar actionBar = getActionBar();
if (actionBar == null){
return;
}
try {
actionBar.setLogo(new ColorDrawable(TiRHelper
.getAndroidResource("color.transparent")));
} catch (ResourceNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例4: setupIds
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
private void setupIds() {
try {
container = TiRHelper.getResource("id.container");
image_container_id = TiRHelper.getResource("id.image_container");
main_layout_id = TiRHelper.getResource("layout.container");
main_image_view = TiRHelper.getResource("layout.image_picker");
image_id = TiRHelper.getResource("id.photo_gallery_image_view");
image_cover = TiRHelper.getResource("id.coverView");
image_checkbox = TiRHelper.getResource("id.checkbox");
error_image = TiRHelper.getResource("drawable.no_image");
} catch (ResourceNotFoundException e) {
Log.i(TAG, "XML resources could not be found!!!");
}
}
示例5: getNotification
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
@Override
protected Notification getNotification(Context context, Intent intent) {
Notification notification = super.getNotification(context, intent);
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
notification.color = context.getResources().getColor(TiRHelper.getResource("color.parse_notification_color"));
}
} catch (Exception e){
Log.e("Push", "Exception: " + e.toString());
}
return notification;
}
示例6: getR
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getR(String path) {
try {
return TiRHelper.getResource(path);
} catch (Exception exc) {
return -1;
}
}
示例7: getResource
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
private int getResource(String type, String name) {
int icon = 0;
if (name != null) {
int index = name.lastIndexOf(".");
if (index > 0) name = name.substring(0, index);
try {
icon = TiRHelper.getApplicationResource(type + "." + name);
} catch (TiRHelper.ResourceNotFoundException ex) {
Log.e(LCAT, type + "." + name + " not found; make sure it's in platform/android/res/" + type);
}
}
return icon;
}
示例8: getString
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getString(String str) {
try {
return TiRHelper.getApplicationResource("string." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例9: getLayout
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getLayout(String str) {
try {
return TiRHelper.getApplicationResource("layout." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例10: getId
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getId(String str) {
try {
return TiRHelper.getApplicationResource("id." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例11: getDrawable
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getDrawable(String str) {
try {
return TiRHelper.getApplicationResource("drawable." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例12: getColor
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getColor(String str) {
try {
return TiRHelper.getApplicationResource("color." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例13: getRaw
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getRaw(String str) {
try {
return TiRHelper.getApplicationResource("raw." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例14: getXML
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public static int getXML(String str) {
try {
return TiRHelper.getApplicationResource("xml." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例15: Drawer
import org.appcelerator.titanium.util.TiRHelper; //导入依赖的package包/类
public Drawer(final DrawerProxy proxy) {
super(proxy);
try {
string_drawer_open = TiRHelper.getResource("string.drawer_open");
string_drawer_close = TiRHelper.getResource("string.drawer_close");
layout_drawer_main = TiRHelper.getResource("layout.drawer_main");
id_content_frame = TiRHelper.getResource("id.content_frame");
id_main_container = TiRHelper.getResource("id.main_container");
id_toolbar = TiRHelper.getResource("id.toolbar");
} catch (ResourceNotFoundException e) {
Log.e(TAG, "XML resources could not be found!!!");
}
AppCompatActivity activity = (AppCompatActivity) proxy.getActivity();
// DrawerLayout
LayoutInflater inflater = LayoutInflater.from(activity);
DrawerLayout layout = (DrawerLayout) inflater.inflate(layout_drawer_main, null,
false);
layout.setDrawerListener(new DrawerListener());
toolbar = (Toolbar)layout.findViewById(id_toolbar);
// If no actionbar exists,
if (activity.getSupportActionBar() == null && activity.getActionBar() == null) {
setToolbar = true;
activity.setSupportActionBar(toolbar);
if (!hideToolbar) {
setToolbarVisible(true);
}
}
// TiUIView
setNativeView(layout);
}