Java源码示例:com.joanzapata.iconify.fonts.FontAwesomeModule
示例1
/**
* 访问本机地址须使用IP地址访问无法使用localhost形式
*/
@Override
public void onCreate() {
super.onCreate();
final ArrayList<Interceptor> interceptors = initInterceptors();
Latte.init(this)
.withApiHost("http://192.168.1.54:8082")
.withInterceptors(interceptors)
.withIcon(new FontAwesomeModule())
.withJavascriptInterface("latte")
.withWebEvent("test",new TestEvent())
.configure();
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
SDKInitializer.initialize(this);
//自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型.
//包括BD09LL和GCJ02两种坐标,默认是BD09LL坐标。
SDKInitializer.setCoordType(CoordType.BD09LL);
Fragmentation.builder()
// 显示悬浮球 ; 其他Mode:SHAKE: 摇一摇唤出 NONE:隐藏
.stackViewMode(Fragmentation.SHAKE)
.debug(BuildConfig.DEBUG)
.install();
}
示例2
@Override
public void onCreate() {
super.onCreate();
configureCrashReporting();
grblController = this;
// Picasso.Builder builder = new Picasso.Builder(this);
// builder.downloader(new OkHttp3Downloader(this, Integer.MAX_VALUE));
// Picasso picasso = builder.build();
// picasso.setIndicatorsEnabled(BuildConfig.DEBUG);
// picasso.setLoggingEnabled(BuildConfig.DEBUG);
// Picasso.setSingletonInstance(picasso);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
Iconify.with(new FontAwesomeModule());
}
示例3
@Override
public void onCreate() {
super.onCreate();
initLeakCanary();
initXUtils();
createClient();
sApplication = this;
mWebVariable = new HHComicWebVariable(this);
initSDK();
initBugly();
// 初始化第三方库(核心包含的库)
HHEngine.init(this)
.withIcon(new FontAwesomeModule())
.withConnectTimeOut(30000, TimeUnit.MILLISECONDS)
.configure();
}
示例4
@Override
public void onCreate() {
super.onCreate();
Fresco.initialize(this);
LeakCanary.install(this);
JPushInterface.setDebugMode(BuildConfig.DEBUG);
JPushInterface.init(this);
initializeInjector();
initializeInjectorApi();
Iconify.with(new FontAwesomeModule());
}
示例5
private void initIcon() {
Iconify
.with(new FontAwesomeModule())
.with(new EntypoModule())
.with(new TypiconsModule())
.with(new MaterialModule())
.with(new MaterialCommunityModule())
.with(new MeteoconsModule())
.with(new WeathericonsModule())
.with(new SimpleLineIconsModule())
.with(new IoniconsModule());
}
示例6
@Override
public void onCreate() {
// Register Font Awesome module in android-iconify library
Iconify.with(new FontAwesomeModule());
application = this;
// Facebook sdk should be initialized through AndroidManifest meta data declaration but
// we are generating the meta data through gradle script due to which it is necessary
// to manually initialize the sdk here.
// Initialize to a Fake Application ID as it will not connect to the actual API
FacebookSdk.setApplicationId("1234567812345678");
FacebookSdk.sdkInitialize(getApplicationContext());
}
示例7
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
sharedPref = EnhancedSharedPreferences.getInstance(GrblController.getInstance(), getString(R.string.shared_preference_key));
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if(getSupportActionBar() != null) getSupportActionBar().setSubtitle(getString(R.string.text_not_connected));
applicationSetup();
binding.setMachineStatus(machineStatus);
CardView viewLastToast = findViewById(R.id.view_last_toast);
viewLastToast.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if(lastToastMessage != null) grblToast(lastToastMessage);
return true;
}
});
for(int resourceId: new Integer[]{R.id.wpos_edit_x, R.id.wpos_edit_y, R.id.wpos_edit_z}){
IconTextView positionTextView = findViewById(resourceId);
positionTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setWorkPosition(v.getTag().toString());
}
});
}
Iconify.with(new FontAwesomeModule());
setupTabLayout();
checkPowerManagement();
String fcmToken = sharedPref.getString(getString(R.string.firebase_cloud_messaging_token), null);
boolean tokenSent = sharedPref.getBoolean(getString(R.string.firebase_cloud_messaging_token_sent), false);
if(fcmToken != null && !tokenSent) MyFirebaseMessagingService.sendRegistrationToServer(fcmToken);
if(!this.hasPaidVersion()){
freeAppNotification();
}
}
示例8
private void initIconify() {
//FontAwesomeIcons.fa_volume_up
Iconify.with(new FontAwesomeModule());
}
示例9
/**
* Initializes the request manager, image cache,
* all third party integrations and shared components.
*/
private void init() {
application = this;
// FIXME: Disable RoboBlender to avoid annotation processor issues for now, as we already have plans to move to some other DI framework. See LEARNER-1687.
// ref: https://github.com/roboguice/roboguice/wiki/RoboBlender-wiki#disabling-roboblender
// ref: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration
RoboGuice.setUseAnnotationDatabases(false);
injector = RoboGuice.getOrCreateBaseApplicationInjector((Application) this, RoboGuice.DEFAULT_STAGE,
(Module) RoboGuice.newDefaultRoboModule(this), (Module) new EdxDefaultModule(this));
injector.injectMembers(this);
EventBus.getDefault().register(new CrashlyticsCrashReportObserver());
if (config.getNewRelicConfig().isEnabled()) {
EventBus.getDefault().register(new NewRelicObserver());
}
// initialize NewRelic with crash reporting disabled
if (config.getNewRelicConfig().isEnabled()) {
//Crash reporting for new relic has been disabled
NewRelic.withApplicationToken(config.getNewRelicConfig().getNewRelicKey())
.withCrashReportingEnabled(false)
.start(this);
}
// Add Segment as an analytics provider if enabled in the config
if (config.getSegmentConfig().isEnabled()) {
analyticsRegistry.addAnalyticsProvider(injector.getInstance(SegmentAnalytics.class));
}
if (config.getFirebaseConfig().isAnalyticsSourceFirebase()) {
// Only add Firebase as an analytics provider if enabled in the config and Segment is disabled
// because if Segment is enabled, we'll be using Segment's implementation for Firebase
analyticsRegistry.addAnalyticsProvider(injector.getInstance(FirebaseAnalytics.class));
}
if (config.getFirebaseConfig().isEnabled()) {
// Firebase notification needs to initialize the FirebaseApp before
// subscribe/unsubscribe to/from the topics
FirebaseApp.initializeApp(this);
if (config.areFirebasePushNotificationsEnabled()) {
NotificationUtil.subscribeToTopics(config);
} else if (!config.areFirebasePushNotificationsEnabled()) {
NotificationUtil.unsubscribeFromTopics(config);
}
}
registerReceiver(new NetworkConnectivityReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
registerReceiver(new NetworkConnectivityReceiver(), new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));
checkIfAppVersionUpgraded(this);
// Register Font Awesome module in android-iconify library
Iconify.with(new FontAwesomeModule());
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/OpenSans-Regular.ttf")
.setFontAttrId(R.attr.fontPath)
.build()
);
// Init Branch
if (config.getBranchConfig().isEnabled()) {
Branch.getAutoInstance(this);
}
// Force Glide to use our version of OkHttp which now supports TLS 1.2 out-of-the-box for
// Pre-Lollipop devices
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Glide.get(this).getRegistry().replace(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(injector.getInstance(OkHttpClientProvider.class).get()));
}
// Initialize Facebook SDK
boolean isOnZeroRatedNetwork = NetworkUtil.isOnZeroRatedNetwork(getApplicationContext(), config);
if (!isOnZeroRatedNetwork && config.getFacebookConfig().isEnabled()) {
// Facebook sdk should be initialized through AndroidManifest meta data declaration but
// we are generating the meta data through gradle script due to which it is necessary
// to manually initialize the sdk here.
FacebookSdk.setApplicationId(config.getFacebookConfig().getFacebookAppId());
FacebookSdk.sdkInitialize(getApplicationContext());
}
if (PermissionsUtil.checkPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE, this)) {
deleteExtraDownloadedFiles();
}
}