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


Java TiRHelper类代码示例

本文整理汇总了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!!!");
	}
}
 
开发者ID:prashantsaini1,项目名称:titanium-android-imagepicker,代码行数:17,代码来源:ImageViewerActivity.java

示例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;
}
 
开发者ID:morinel,项目名称:gcmpush,代码行数:18,代码来源:GCMIntentService.java

示例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();
	}
}
 
开发者ID:ricardoalcocer,项目名称:actionbarextras,代码行数:19,代码来源:ActionbarextrasModule.java

示例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!!!");
	}
}
 
开发者ID:prashantsaini1,项目名称:titanium-android-imagepicker,代码行数:16,代码来源:ImagePickerActivity.java

示例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;
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:15,代码来源:ParseModuleBroadcastReceiver.java

示例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;
	}
}
 
开发者ID:prashantsaini1,项目名称:ti-chrometabs,代码行数:9,代码来源:Utils.java

示例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;
}
 
开发者ID:caffeinalab,项目名称:ti.goosh,代码行数:15,代码来源:IntentService.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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;
	}
}
 
开发者ID:PDF417,项目名称:pdf417-titanium,代码行数:9,代码来源:RHelper.java

示例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);

}
 
开发者ID:manumaticx,项目名称:Ti.DrawerLayout,代码行数:38,代码来源:Drawer.java


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