示例#1
0
 public void init() {
   username = (EditText) findViewById(R.id.et_email);
   pass = (EditText) findViewById(R.id.et_pass);
   btnfb = (Button) findViewById(R.id.btn_fb);
   btntwit = (Button) findViewById(R.id.btn_twit);
   RelativeLayout rl = (RelativeLayout) findViewById(R.id.header);
   rl.bringToFront();
 }
  public void closeSideBar() {

    if (mRlSideBarHolder.getVisibility() == View.VISIBLE) {
      mRlBody.bringToFront();
      mRlSideBarHolder.startAnimation(SpikaApp.getSlideOutLeft());
      mRlBody.startAnimation(SpikaApp.getSlideInRight());
      mRlSideBarHolder.setVisibility(View.INVISIBLE);
      mSideBarOpened = false;
    }

    enableViews();
  }
示例#3
0
    @SuppressWarnings("deprecation")
    @Override
    public View onCreateView(
        LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

      view = inflater.inflate(R.layout.discover, container, false);
      viewPager = (ViewPager) view.findViewById(R.id.viewPager);
      gridViewq = (WrappingGridView) view.findViewById(R.id.gridView);
      listView = (WrappingListView) view.findViewById(R.id.listView);

      round1 = (ImageView) view.findViewById(R.id.round1);
      round2 = (ImageView) view.findViewById(R.id.round2);
      roundRel = (RelativeLayout) view.findViewById(R.id.roundRel);

      round1.setImageResource(R.drawable.active_round);
      round2.setImageResource(R.drawable.inactive_round);

      viewPager.setOnPageChangeListener(
          new OnPageChangeListener() {

            public void onPageSelected(int arg0) {
              // TODO Auto-generated method stub
              if (viewPager.getCurrentItem() == 0) {
                round1.setImageResource(R.drawable.active_round);
                round2.setImageResource(R.drawable.inactive_round);
              } else {
                round1.setImageResource(R.drawable.inactive_round);
                round2.setImageResource(R.drawable.active_round);
              }
            }

            public void onPageScrolled(int arg0, float arg1, int arg2) {
              // TODO Auto-generated method stub

            }

            public void onPageScrollStateChanged(int arg0) {
              // TODO Auto-generated method stub

            }
          });

      roundRel.bringToFront();
      round1.setVisibility(View.VISIBLE);
      round2.setVisibility(View.VISIBLE);

      Log.e("list count==", "" + listView.getChildCount());

      return view;
    }
示例#4
0
 // METHOD - shows progress bar
 public void showProgress(Context context) {
   if (layoutProgress == null) {
     layoutProgress = new RelativeLayout(context);
     progressBar = new ProgressBar(context);
     progressBar.setIndeterminate(true);
     RelativeLayout.LayoutParams rlp =
         new RelativeLayout.LayoutParams(
             RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
     layoutProgress.setLayoutParams(rlp);
     layoutProgress.addView(progressBar);
     rootView.addView(layoutProgress);
     layoutProgress.bringToFront();
     layoutProgress.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
   }
   layoutProgress.setVisibility(View.VISIBLE);
 }
  public void openSideBar() {

    getActivitySummary();

    mRlSideBarHolder.setVisibility(View.VISIBLE);
    mRlSideBarHolder.bringToFront();
    mRlSideBarHolder.startAnimation(SpikaApp.getSlideInLeft());
    mRlBody.startAnimation(SpikaApp.getSlideOutRight());
    mSideBarOpened = true;

    if (!this.equals(RecentActivityActivity.getInstance())
        && !this.getComponentName().toString().contains("UsersActivity")
        && !this.getComponentName().toString().contains("GroupsActivity")) {
      hideKeyboard();
    }

    disableViews();
  }
示例#6
0
  public static void Create(FrameLayout mFrameContainer, Activity activity, int aDelay) {
    Log.d("Python", "ProgressScreen");

    // Compute the width of a carousel item based on the screen width and number of initial items.
    final DisplayMetrics displayMetrics = new DisplayMetrics();
    activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    final int displayWidth = (int) (displayMetrics.widthPixels);
    final int displayHeight = (int) (displayMetrics.heightPixels);

    // create the linear layout
    mContainer = new RelativeLayout(activity);
    RelativeLayout.LayoutParams params =
        new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    mContainer.setHorizontalScrollBarEnabled(true);
    mContainer.setLayoutParams(params);
    mContainer.setBackgroundColor(0xFF212121);

    // Set the image view resource
    InputStream is = activity.getClass().getResourceAsStream("/res/welcome.png");
    ImageView imageItem = new ImageView(activity);
    imageItem.setImageDrawable(Drawable.createFromStream(is, ""));
    imageItem.setScaleType(ImageView.ScaleType.CENTER_CROP);
    float fact =
        (float) imageItem.getDrawable().getIntrinsicHeight()
            / (float) imageItem.getDrawable().getIntrinsicWidth();
    imageItem.setLayoutParams(
        new RelativeLayout.LayoutParams(displayWidth, (int) (displayWidth * fact)));
    // imageItem.setLayoutParams(new
    // RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT,
    // RelativeLayout.LayoutParams.WRAP_CONTENT));

    /// Add image view to the carousel container
    mContainer.addView(imageItem);

    // Set the image view resource
    InputStream is2 = activity.getClass().getResourceAsStream("/res/progress.png");
    mImageProgress = new ImageView(activity);
    mImageProgress.setImageDrawable(Drawable.createFromStream(is2, ""));
    int w = mImageProgress.getDrawable().getIntrinsicWidth();
    int h = mImageProgress.getDrawable().getIntrinsicHeight();
    RelativeLayout.LayoutParams progressparams = new RelativeLayout.LayoutParams(w, h);
    int maxW = (int) (displayWidth * 0.7);
    progressparams.leftMargin = (int) ((displayWidth - maxW) / 2);
    progressparams.topMargin = (int) (displayHeight * 720 / 1280);
    mImageProgress.setLayoutParams(progressparams);
    /// Add image view to the carousel container
    mContainer.addView(mImageProgress);

    mFrameContainer.addView(mContainer);
    mContainer.bringToFront();

    // Set animation
    ScaleAnimation anim =
        new ScaleAnimation(
            1.0f,
            (float) maxW / (float) w,
            (float) displayWidth / (float) 720,
            (float) displayWidth / (float) 720,
            Animation.RELATIVE_TO_SELF,
            0.0f,
            Animation.RELATIVE_TO_SELF,
            0.0f);
    anim.setDuration(aDelay);
    anim.setFillAfter(true);
    anim.setAnimationListener(
        new AnimationListener() {
          @Override
          public void onAnimationStart(Animation animation) {
            Log.d("Python", "Progress Animation started");
          }

          @Override
          public void onAnimationRepeat(Animation animation) {}

          @Override
          public void onAnimationEnd(Animation animation) {
            Log.d("Python", "Progress Animation ended");
            ProgressScreen.mImageProgress = null;
          }
        });
    mImageProgress.startAnimation(anim);
  }