org.androidannotations.annotations.AfterInject Java Examples

The following examples show how to use org.androidannotations.annotations.AfterInject. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: gpsMonitor.java    From wifi_backend with GNU General Public License v3.0 6 votes vote down vote up
@AfterInject
protected void init() {
    if (DEBUG) {
        Log.i(TAG, "service started");
    }

    sampleTime = Configuration.with(this).minimumGpsTimeInMilliseconds();
    sampleDistance = Configuration.with(this).minimumGpsDistanceInMeters();

    try {
        locationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER,
                sampleTime,
                sampleDistance,
                gpsMonitor.this);
    } catch (SecurityException ex) {
        if(DEBUG) {
            Log.w(TAG, "init()", ex);
        }
    }

    Configuration.with(this).register(this);
}
 
Example #2
Source File: IntentResolvers.java    From moVirt with Apache License 2.0 5 votes vote down vote up
@AfterInject
void init() {
    resolvers.put(StorageDomain.class, storageDomainIntentResolver);
    resolvers.put(Host.class, hostIntentResolver);
    resolvers.put(Vm.class, vmIntentResolver);
    resolvers.put(Snapshot.class, snapshotIntentResolver);
}
 
Example #3
Source File: ProviderFacade.java    From moVirt with Apache License 2.0 5 votes vote down vote up
@AfterInject
void initContentProviderClient() {
    final ContentResolver contentResolver = context.getContentResolver();
    contentClient = contentResolver.acquireContentProviderClient(OVirtContract.BASE_CONTENT_URI);

    SqlBrite sqlBrite = new SqlBrite.Builder().build();
    // TODO possibly refactor to use sqlBrite.wrapDatabaseHelper(), but all queries must use SqlBrite
    briteResolver = sqlBrite.wrapContentProvider(contentResolver, Schedulers.io());
}
 
Example #4
Source File: UriDependencies.java    From moVirt with Apache License 2.0 5 votes vote down vote up
@AfterInject
void init() {
    for (final UriDependency dependency : UriMatcher.getUriDependencies()) {
        context.getContentResolver().registerContentObserver(dependency.observe, true, new ContentObserver(null) {
            @Override
            public void onChange(boolean selfChange) {
                super.onChange(selfChange);
                context.getContentResolver().notifyChange(dependency.notify, null);
            }
        });
    }
}
 
Example #5
Source File: ViewService.java    From simiasque with Mozilla Public License 2.0 5 votes vote down vote up
@AfterInject
public void init() {
    if (holder.getCurrentOverlay() == null) {
        View overlayView = new OverlayView(this);
        windowManager.addView(overlayView, OverlayView.createLayoutParams(retrieveStatusBarHeight() + SAFETY_MARGIN));
        holder.setCurrentOverlay(overlayView);
    }
    holder.hideView();
}
 
Example #6
Source File: NotificationBuilder.java    From settlers-remake with MIT License 5 votes vote down vote up
@AfterInject
void setupBuilder() {
	Intent gameActivityIntent = GameActivity_.intent(context).action(Actions.ACTION_RESUME_GAME).get();
	PendingIntent gameActivityPendingIntent = PendingIntent.getActivity(context, 0, gameActivityIntent, 0);

	builder = new NotificationCompat.Builder(context, context.getString(R.string.notification_channel_id))
			.setSmallIcon(R.drawable.icon)
			.setContentTitle(title)
			.setContentIntent(gameActivityPendingIntent)
			.setPriority(NotificationCompat.PRIORITY_DEFAULT);
}
 
Example #7
Source File: CommonSharedPreferencesHelper.java    From moVirt with Apache License 2.0 4 votes vote down vote up
@AfterInject
void initialize() {
    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
}
 
Example #8
Source File: FinancistoApp.java    From financisto with GNU General Public License v2.0 4 votes vote down vote up
@AfterInject
public void init() {
    bus.register(driveClient);
}
 
Example #9
Source File: CreateSnapshotDialogFragment.java    From moVirt with Apache License 2.0 4 votes vote down vote up
@AfterInject
public void setVm() {
    if (!StringUtils.isEmpty(vmId)) {
        currentVm = providerFacade.query(Vm.class).id(vmId).first();
    }
}
 
Example #10
Source File: AccountRxStore.java    From moVirt with Apache License 2.0 4 votes vote down vote up
@AfterInject
void init() {
    // refresh account even though we add listener later
    Set<MovirtAccount> accounts = refreshAccounts();

    // load active account from preferences
    final StoredActiveSelection storedSelection = commonSharedPreferencesHelper.getActiveSelection();
    for (MovirtAccount account : accounts) {
        if (account.getId().equals(storedSelection.accountId)) {
            ACTIVE_SELECTION.onNext(new ActiveSelection(account, storedSelection.clusterId));
        }
    }

    Observable.combineLatest(providerFacade.query(Cluster.class).asObservable(),
            ACTIVE_SELECTION.distinctUntilChanged(), SelectionClusters::new)
            .subscribeOn(Schedulers.computation())
            .subscribe(selectionClusters -> {
                ActiveSelection selection = selectionClusters.getActiveSelection();
                // preserve active one in preferences
                commonSharedPreferencesHelper.setActiveSelection(new StoredActiveSelection(selection));

                if (selection.isCluster()) {
                    // check if cluster name changed
                    for (Cluster cluster : selectionClusters.getClusters()) {
                        if (selection.isCluster(cluster.getId())) {
                            if (!selection.isClusterName(cluster.getName())) {
                                ACTIVE_SELECTION.onNext(new ActiveSelection(selection.getAccount(),
                                        selection.getClusterId(), cluster.getName()));
                            }
                            return;
                        }
                    }
                    ACTIVE_SELECTION.onNext(ActiveSelection.ALL_ACTIVE); // cluster deleted
                }
            });

    ALL_ACCOUNTS.map(allAccounts -> accounts.size())
            .distinctUntilChanged()
            .filter(size -> size == 0) // detect only change when all deleted, it is set to true on account creation
            .subscribeOn(Schedulers.computation())
            .subscribe(accountSize -> commonSharedPreferencesHelper.setFirstAccountConfigured(false));

    Observable.combineLatest(REMOVED_ACCOUNT, ACTIVE_SELECTION, SelectedAccountRemoved::new)
            .filter(SelectedAccountRemoved::isRemoved)
            .subscribeOn(Schedulers.computation())
            .subscribe(removed -> ACTIVE_SELECTION.onNext(ActiveSelection.ALL_ACTIVE));

    // listen for system changes on accounts
    accountManagerHelper.addOnAccountsUpdatedListener(accs -> ALL_ACCOUNTS.onNext(AllAccounts.newInstance(accs)));
}
 
Example #11
Source File: Param.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void init(){
    wheelList = new ArrayList<ParamWidget>();
    UIHelper.getDialog(R.string.tips_loading_params).show();
    loadData();
}
 
Example #12
Source File: CommonActivity.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void initDialog(){
    UIHelper.buildDialog(this, this);
    cacheHelper = new CacheHelper(this);
}
 
Example #13
Source File: Main.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void init(){
    mContext = this;
}
 
Example #14
Source File: CommonFragment.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void initDialog(){
    UIHelper.buildDialog(getActivity(), this);
}
 
Example #15
Source File: Card.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void init(){
    ctx = getSherlockActivity();
    setTitle(R.string.title_card);
    tips_empty = R.string.tips_card_null;
}
 
Example #16
Source File: BorrowedBook.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
void initAfterInject(){
    setQueryTarget(QUERY_FOR_LIBRARY);
}
 
Example #17
Source File: BackendService.java    From wifi_backend with GNU General Public License v3.0 4 votes vote down vote up
@AfterInject
protected void init() {
    database = SamplerDatabase.getInstance(this);
    wifiReceiver = new WifiReceiver(wifiManager, this);
}
 
Example #18
Source File: AbstractFragmentHandler.java    From overpasser with Apache License 2.0 4 votes vote down vote up
@AfterInject
protected void setFragmentActivity() {
    fragmentActivity = getFragmentActivity();
}
 
Example #19
Source File: MapFragment.java    From overpasser with Apache License 2.0 4 votes vote down vote up
@AfterInject
void init() {
    uiHandler.setFragment(this);
    poiHandler.setFragment(this);
}
 
Example #20
Source File: DisplayHelper.java    From GameOfLife with MIT License 4 votes vote down vote up
@AfterInject
protected void init() {
    display = windowManager.getDefaultDisplay();
}
 
Example #21
Source File: HalRestTemplate.java    From moserp with Apache License 2.0 4 votes vote down vote up
@AfterInject
void addInterceptors() {
    setInterceptors(Collections.<ClientHttpRequestInterceptor>singletonList(basicAuthorizationInterceptor));
}
 
Example #22
Source File: IncomingDeliveryActivity.java    From moserp with Apache License 2.0 4 votes vote down vote up
@AfterInject
void adjustRestService() {
    restServiceRegistry.adjustRestService(incomingDeliveryRestService, "MOS_ERP_INVENTORY_MODULE");
}
 
Example #23
Source File: InventoryTransferActivity.java    From moserp with Apache License 2.0 4 votes vote down vote up
@AfterInject
void adjustRestService() {
    restServiceRegistry.adjustRestService(inventoryTransferRestService, "MOS_ERP_INVENTORY_MODULE");
}
 
Example #24
Source File: InventoryActivity.java    From moserp with Apache License 2.0 4 votes vote down vote up
@AfterInject
void adjustRestService() {
    restServiceRegistry.adjustRestService(inventoryItemRestService, "MOS_ERP_INVENTORY_MODULE");
}
 
Example #25
Source File: OutgoingDeliveryActivity.java    From moserp with Apache License 2.0 4 votes vote down vote up
@AfterInject
void adjustRestService() {
    restServiceRegistry.adjustRestService(outgoingDeliveryRestService, "MOS_ERP_INVENTORY_MODULE");
}
 
Example #26
Source File: SnappyDatabase.java    From MVPAndroidBootstrap with Apache License 2.0 4 votes vote down vote up
@AfterInject
protected void afterBaseInject() {
    openDatabase();
}
 
Example #27
Source File: CleanApplication.java    From MVPAndroidBootstrap with Apache License 2.0 4 votes vote down vote up
@AfterInject
void onAfterInjectFinished() {
    networkErrorHandler.setSnackBarBackgroundColor(snackBarColor);
}
 
Example #28
Source File: OpenWeatherClient.java    From MVPAndroidBootstrap with Apache License 2.0 4 votes vote down vote up
@AfterInject
void onAfterInjectFinished() {
    openWeatherAPI = initRestAdapter(ENDPOINT, OpenWeatherAPI.class);
}
 
Example #29
Source File: GoogleDriveClient.java    From financisto with GNU General Public License v2.0 4 votes vote down vote up
@AfterInject
public void init() {
    bus.register(this);
}
 
Example #30
Source File: CalculatorInput.java    From financisto with GNU General Public License v2.0 2 votes vote down vote up
@AfterInject
public void init() {

}