private void setChannelIcon() {

    if (channelLayoutId <= 0) return;

    if (channelIconInflateResult == null || channelDataSource == null)
      channelIconInflateResult =
          Binder.inflateView(
              BindableChannelVideoStripLayout.this.getContext(),
              channelLayoutId,
              BindableChannelVideoStripLayout.this,
              false);

    if (isChannelLayoutAdded) {
      removeViewAt(0);
    }

    // BindableChannelVideoStripLayout.this.addView(inflateResult.rootView,
    // 0);
    isChannelLayoutAdded = true;

    if (channelDataSource == null) {
      Binder.bindView(
          BindableChannelVideoStripLayout.this.getContext(), channelIconInflateResult, null);
    } else {
      Binder.bindView(
          BindableChannelVideoStripLayout.this.getContext(),
          channelIconInflateResult,
          channelDataSource);
    }
  }
  @SuppressWarnings({"rawtypes", "unchecked"})
  private void insertItem(int pos, Object item) {
    if (layout == null) return;

    int layoutId = layout.getLayoutId();
    if (layoutId < 1 && layout.getLayoutName() != null) {
      IObservable<?> observable = null;
      InnerFieldObservable ifo = new InnerFieldObservable(layout.getLayoutName());
      if (ifo.createNodes(item)) {
        observable = ifo;
      } else {
        Object rawField;
        try {
          rawField = Binder.getSyntaxResolver().getFieldForModel(layout.getLayoutName(), item);
        } catch (SyntaxResolveException e) {
          BindingLog.exception("BindableLinearLayout.insertItem()", e);
          return;
        }
        if (rawField instanceof IObservable<?>) observable = (IObservable<?>) rawField;
        else if (rawField != null)
          observable = new ConstantObservable(rawField.getClass(), rawField);
      }

      if (observable != null) {
        observableItemsLayoutID.add(observable, item);
        Object obj = observable.get();
        if (obj instanceof Integer) layoutId = (Integer) obj;
      }
    }
    View child = null;

    if (layoutId < 1) {
      TextView textView = new TextView(getContext());
      textView.setText(
          "binding error - pos: "
              + pos
              + " has no layout - please check binding:itemPath or the layout id in viewmodel");
      textView.setTextColor(Color.RED);
      child = textView;
    } else {
      Binder.InflateResult result = Binder.inflateView(getContext(), layoutId, this, false);
      for (View view : result.processedViews) {
        AttributeBinder.getInstance().bindView(getContext(), view, item);
      }

      child = result.rootView;
    }

    videoListViews.add(child);
    // this.addView(child, pos);
  }
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   Binder.setAndBindContentView(this, R.layout.tab, this);
   // getActionBar().setDisplayHomeAsUpEnabled(false);
   if (isFirstTime()) {
     Intent i = new Intent(this, ActivityHelp.class);
     this.startActivity(i);
     getSharedPreferences(KEY, Context.MODE_PRIVATE)
         .edit()
         .putBoolean(KEY_IS_FIRST_TIME, false)
         .commit();
   }
 }
 @Override
 public void onCreate() {
   super.onCreate();
   Binder.init(this);
   ImageLoaderConfiguration config =
       new ImageLoaderConfiguration.Builder(getApplicationContext())
           .threadPriority(Thread.NORM_PRIORITY - 2)
           .denyCacheImageMultipleSizesInMemory()
           .diskCacheFileNameGenerator(new Md5FileNameGenerator())
           .diskCacheSize(50 * 1024 * 1024)
           // 50 Mb
           .tasksProcessingOrder(QueueProcessingType.LIFO)
           .writeDebugLogs() // Remove for release app
           .build();
   // Initialize ImageLoader with configuration.
   ImageLoader.getInstance().init(config);
 }
 @Override
 public void onCreate() {
   super.onCreate();
   Binder.init(this);
 }
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   ViewModel vm = new ProfileViewModel(this);
   Binder.init(this.getApplication());
   Binder.setAndBindContentView(this, R.layout.profile, vm);
 }
Ejemplo n.º 7
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   model = new RepairUploadModel(this);
   Binder.setAndBindContentView(this, R.layout.repair_upload, model);
 }
 public ModalCheckedItemPositions(ListView view) {
   super(SparseBooleanArray.class, view, "modalCheckedItemPositions");
   Binder.getMulticastListenerForView(view, MultiChoiceModeListenerMulticast.class).register(this);
 }