@Override
  public void onActivityCreated2(Bundle savedInstanceState) {

    HashMap<String, String> url_maps = new HashMap<String, String>();
    url_maps.put(
        "Hannibal",
        "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
    url_maps.put("Big Bang Theory", "http://tvfiles.alphacoders.com/100/hdclearart-10.png");
    url_maps.put("House of Cards", "http://cdn3.nflximg.net/images/3093/2043093.jpg");
    url_maps.put(
        "Game of Thrones",
        "http://images.boomsbeat.com/data/images/full/19640/game-of-thrones-season-4-jpg.jpg");
    for (String name : url_maps.keySet()) {
      DefaultSliderView defaultSliderView = new DefaultSliderView(getActivity());
      defaultSliderView.image(url_maps.get(name));
      TextSliderView textSliderView = new TextSliderView(getActivity());
      // initialize a SliderLayout
      textSliderView
          .description(name)
          .image(url_maps.get(name))
          .setScaleType(BaseSliderView.ScaleType.Fit)
          .setOnSliderClickListener(this);
      // add your extra information
      textSliderView.getBundle().putString("extra", name);
      mDemoSlider.addSlider(defaultSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
    mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    mDemoSlider.setCustomIndicator(customIndicator);
  }
Esempio n. 2
0
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == TAKE_PIC && resultCode == RESULT_OK) {
     if (nbPicture == 0) sliderShow.removeAllSliders();
     TextSliderView pic_test = new TextSliderView(this);
     pic_test.description("C'est bon ça").image(outPutfileUri.toString());
     sliderShow.addSlider(pic_test);
     nbPicture++;
   }
 }
Esempio n. 3
0
  private void initSlider() {

    if (mBanner != null) {

      for (Banner banner : mBanner) {

        TextSliderView textSliderView = new TextSliderView(this.getActivity());
        textSliderView.image(banner.getImgUrl());
        textSliderView.description(banner.getName());
        textSliderView.setScaleType(BaseSliderView.ScaleType.Fit);
        mSliderLayout.addSlider(textSliderView);
      }
    }

    mSliderLayout.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);

    mSliderLayout.setCustomAnimation(new DescriptionAnimation());
    mSliderLayout.setPresetTransformer(SliderLayout.Transformer.RotateUp);
    mSliderLayout.setDuration(3000);
  }
Esempio n. 4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add_vue);

    addPhoto = (FloatingActionButton) findViewById(R.id.camera);

    /* Initialise toolbar */
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_white_24dp);
    toolbar.setNavigationOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Tool.reset_bellevue_dir(root);
            finish();
          }
        });

    TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
    mTitle.setTypeface(
        com.bellevue.starter.CustomFontsLoader.getTypeface(
            this, com.bellevue.starter.CustomFontsLoader.AlexBrush));

    toolbar.inflateMenu(R.menu.menu_add_view);

    /* Initialise slider */
    sliderShow = (SliderLayout) findViewById(R.id.slider);

    if (nbPicture == 0) {
      TextSliderView picture1 = new TextSliderView(this);
      picture1
          .description("Take some pictures !")
          .image("https://tedconfblog.files.wordpress.com/2014/12/8photography_tips.png");
      sliderShow.addSlider(picture1);
      sliderShow.stopAutoCycle();
    }

    /* Take Picture */
    takePhoto();

    /* Initialise select categorie */
    Resources res = getResources();
    int flat_blu_app = res.getColor(R.color.pri_dark);
    final int flat_blu = res.getColor(R.color.water_point);
    final int flat_green = res.getColor(R.color.garden_point);
    final int flat_yellow = res.getColor(R.color.landscape);
    final int flat_grey = res.getColor(R.color.place);

    /* Bubble help */
    final TextView categorie_info = (TextView) findViewById(R.id.info);
    /*
    Drawable[] bubble = categorie_info.getCompoundDrawables();
    if (bubble[0] != null) {
        bubble[0].setColorFilter(flat_blu_app, PorterDuff.Mode.MULTIPLY);
    }
    */

    /* ImageView Color */
    ImageView cat1 = (ImageView) findViewById(R.id.water_point);
    ImageView cat2 = (ImageView) findViewById(R.id.garden_point);
    ImageView cat3 = (ImageView) findViewById(R.id.landscape);
    ImageView cat4 = (ImageView) findViewById(R.id.place);

    Drawable dr =
        ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_add_location_white_24dp);
    Bitmap bitmap = ((BitmapDrawable) dr).getBitmap();

    Drawable d =
        new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(bitmap, 100, 100, true));
    Drawable clone = d.getConstantState().newDrawable();
    Drawable clone2 = clone.getConstantState().newDrawable();
    Drawable clone3 = clone2.getConstantState().newDrawable();

    cat1.setImageDrawable(d);
    cat1.setColorFilter(flat_blu);
    cat2.setImageDrawable(clone);
    cat2.setColorFilter(flat_green);
    cat3.setImageDrawable(clone2);
    cat3.setColorFilter(flat_yellow);
    cat4.setImageDrawable(clone3);
    cat4.setColorFilter(flat_grey);

    m_one = (RadioButton) findViewById(R.id.rad1);
    m_two = (RadioButton) findViewById(R.id.rad2);
    m_three = (RadioButton) findViewById(R.id.rad3);
    m_four = (RadioButton) findViewById(R.id.rad4);

    t1 = (android.support.design.widget.TextInputLayout) findViewById(R.id.text1);
    t2 = (android.support.design.widget.TextInputLayout) findViewById(R.id.text2);

    botLay = (LinearLayout) findViewById(R.id.bottomLay);

    m_one.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            m_one.setChecked(true);
            m_two.setChecked(false);
            m_three.setChecked(false);
            m_four.setChecked(false);
            Toast.makeText(getBaseContext(), "Vous selectionnez Point d'eau", Toast.LENGTH_SHORT)
                .show();
            t1.setBackgroundColor(flat_blu);
            t2.setBackgroundColor(flat_blu);
            botLay.setBackgroundColor(flat_blu);
          }
        });

    m_two.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            m_one.setChecked(false);
            m_two.setChecked(true);
            m_three.setChecked(false);
            m_four.setChecked(false);
            Toast.makeText(getBaseContext(), "Vous selectionnez Jardin", Toast.LENGTH_SHORT).show();
            t1.setBackgroundColor(flat_green);
            t2.setBackgroundColor(flat_green);
            botLay.setBackgroundColor(flat_green);
          }
        });

    m_three.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            m_one.setChecked(false);
            m_two.setChecked(false);
            m_three.setChecked(true);
            m_four.setChecked(false);
            Toast.makeText(getBaseContext(), "Vous selectionnez Panorama ", Toast.LENGTH_SHORT)
                .show();
            t1.setBackgroundColor(flat_yellow);
            t2.setBackgroundColor(flat_yellow);
            botLay.setBackgroundColor(flat_yellow);
          }
        });

    m_four.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            m_one.setChecked(false);
            m_two.setChecked(false);
            m_three.setChecked(false);
            m_four.setChecked(true);
            Toast.makeText(getBaseContext(), "Vous selectionnez Places", Toast.LENGTH_SHORT).show();

            t1.setBackgroundColor(flat_grey);
            t2.setBackgroundColor(flat_grey);
            botLay.setBackgroundColor(flat_grey);
          }
        });
  }