android.support.percent.PercentRelativeLayout Java Examples

The following examples show how to use android.support.percent.PercentRelativeLayout. 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: IOItemAdapter.java    From Ucount with GNU General Public License v3.0 6 votes vote down vote up
public ViewHolder(View view) {
    super(view);
    earnLayout = (PercentRelativeLayout) view.findViewById(R.id.earn_left_layout);
    costLayout = (PercentRelativeLayout) view.findViewById(R.id.cost_right_layout);
    dateBar    = (RelativeLayout) view.findViewById(R.id.date_bar);

    itemImageEarn = (ImageView) view.findViewById(R.id.earn_item_img_main);
    itemImageCost = (ImageView) view.findViewById(R.id.cost_item_img_main);
    itemNameEarn  = (TextView ) view.findViewById(R.id.earn_item_name_main);
    itemNameCost  = (TextView ) view.findViewById(R.id.cost_item_name_main);
    itemMoneyEarn = (TextView ) view.findViewById(R.id.earn_item_money_main);
    itemMoneyCost = (TextView ) view.findViewById(R.id.cost_item_money_main);
    itemDspEarn   = (TextView ) view.findViewById(R.id.earn_item_decription);
    itemDspCost   = (TextView ) view.findViewById(R.id.cost_item_decription);
    itemDate      = (TextView ) view.findViewById(R.id.iotem_date);
}
 
Example #2
Source File: MainActivity.java    From journaldev with MIT License 6 votes vote down vote up
private void showSignInForm() {
    PercentRelativeLayout.LayoutParams paramsLogin = (PercentRelativeLayout.LayoutParams) llRegister.getLayoutParams();
    PercentLayoutHelper.PercentLayoutInfo infoLogin = paramsLogin.getPercentLayoutInfo();
    infoLogin.widthPercent = 0.15f;
    llRegister.requestLayout();


    PercentRelativeLayout.LayoutParams paramsSignup = (PercentRelativeLayout.LayoutParams) llSignIn.getLayoutParams();
    PercentLayoutHelper.PercentLayoutInfo infoSignup = paramsSignup.getPercentLayoutInfo();
    infoSignup.widthPercent = 0.85f;
    llSignIn.requestLayout();

    txtRegister.setVisibility(View.VISIBLE);
    txtSignIn.setVisibility(View.GONE);
    Animation translate = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_left_to_right);
    llSignIn.startAnimation(translate);

    Animation clockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.scale_translate_rotate_left_to_right);
    btnSignIn.startAnimation(clockwise);

}
 
Example #3
Source File: MainActivity.java    From journaldev with MIT License 6 votes vote down vote up
private void showRegisterForm() {
    PercentRelativeLayout.LayoutParams paramsLogin = (PercentRelativeLayout.LayoutParams) llSignIn.getLayoutParams();
    PercentLayoutHelper.PercentLayoutInfo infoLogin = paramsLogin.getPercentLayoutInfo();
    infoLogin.widthPercent = 0.15f;
    llSignIn.requestLayout();


    PercentRelativeLayout.LayoutParams paramsSignup = (PercentRelativeLayout.LayoutParams) llRegister.getLayoutParams();
    PercentLayoutHelper.PercentLayoutInfo infoSignup = paramsSignup.getPercentLayoutInfo();
    infoSignup.widthPercent = 0.85f;
    llRegister.requestLayout();

    txtRegister.setVisibility(View.GONE);
    txtSignIn.setVisibility(View.VISIBLE);
    Animation translate = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_right_to_left);
    llRegister.startAnimation(translate);

    Animation clockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.scale_translate_rotate_right_to_left);
    btnRegister.startAnimation(clockwise);

}
 
Example #4
Source File: MainActivity.java    From FwdPortForwardingApp with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.forwardingManager = ForwardingManager.getInstance();

    setContentView(R.layout.activity_main);
    setSupportActionBar(getActionBarToolbar());
    // getActionBarToolbar().setTitle(R.string.app_tag);
    getActionBarToolbar().setTitle("");
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setIcon(R.drawable.ic_nav_logo);

    // Obtain the FirebaseAnalytics instance.
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

    // Determine if this is first start - and whether to show app intro
    onFirstStart();

    final Intent newRuleIntent = new Intent(this, NewRuleActivity.class);

    // Move to the new rule activity
    this.fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(newRuleIntent);
        }
    });

    // Hide the fab if forwarding is enabled
    // the user should not be able to add/delete rules
    if (this.forwardingManager.isEnabled()) {
        //if the forwarding service is enabled, then we should ensure not to show the fab
        fab.hide();
    } else {
        fab.show();
    }

    // Get all models from the data store
    ruleDao = new RuleDao(new RuleDbHelper(this));
    ruleModels = ruleDao.getAllRuleModels();

    // Set up rule list and empty view
    mRecyclerView = (RecyclerView) findViewById(R.id.rule_recycler_view);
    mRuleListEmptyView = (PercentRelativeLayout) findViewById(R.id.rule_list_empty_view);

    // Use this setting to improve performance if you know that changes
    // In content do not change the layout size of the RecyclerView
    mRecyclerView.setHasFixedSize(true);

    // Use a linear layout manager
    mLayoutManager = new LinearLayoutManager(this);
    mRecyclerView.setLayoutManager(mLayoutManager);

    // Specify an adapter (see also next example)
    ruleListAdapter = new RuleListAdapter(ruleModels, forwardingManager, getApplicationContext());
    mRecyclerView.setAdapter(ruleListAdapter);

    // Store the coordinator layout for snackbar
    coordinatorLayout = (CoordinatorLayout) findViewById(R.id.main_coordinator_layout);


    forwardingServiceIntent = new Intent(this, ForwardingService.class);


    /*
        Service stuff
     */

    // Handle intents
    IntentFilter mStatusIntentFilter = new IntentFilter(
            ForwardingService.BROADCAST_ACTION);

    // Instantiates a new ForwardingServiceResponseReceiver
    ForwardingServiceResponseReceiver forwardingServiceResponseReceiver =
            new ForwardingServiceResponseReceiver();

    // Registers the ForwardingServiceResponseReceiver and its intent filters
    LocalBroadcastManager.getInstance(this).registerReceiver(
            forwardingServiceResponseReceiver,
            mStatusIntentFilter);

    // Get tracker.
    tracker = ((FwdApplication) this.getApplication()).getDefaultTracker();

    Log.i(TAG, "Finished onCreate");
}