Android Open Source - BaseConverterPlus Decimal Converter Fragment






From Project

Back to project page BaseConverterPlus.

License

The source code is released under:

MIT License

If you think the Android project BaseConverterPlus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package codemonkey800.org.baseconverter.fragments;
//  w w w  . jav  a  2  s.com
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import codemonkey800.org.baseconverter.R;

public class DecimalConverterFragment extends BaseConverterFragment {

    public DecimalConverterFragment() {
    }

    public static DecimalConverterFragment instance() {
        return new DecimalConverterFragment();
    }

    @Nullable
    @Override
    public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) {
        View view = super.onCreateView( inflater, container, savedInstanceState );
        mMode = BaseMode.DecToBin;

        Button modeOneKey = ( Button ) view.findViewById( R.id.mode_one_key );
        Button modeTwoKey = ( Button ) view.findViewById( R.id.mode_two_key );
        final TextView baseMode = ( TextView ) view.findViewById( R.id.base_mode );

        baseMode.setText( "0b" );

        modeOneKey.setText( "0b" );
        modeOneKey.setOnClickListener( new View.OnClickListener() {
            @Override
            public void onClick( View v ) {
                mMode = BaseMode.DecToBin;
                baseMode.setText( "0b" );
            }
        } );
        modeTwoKey.setText( "0x" );
        modeTwoKey.setOnClickListener( new View.OnClickListener() {
            @Override
            public void onClick( View v ) {
                mMode = BaseMode.DecToHex;
                baseMode.setText( "0x" );
            }
        } );

        return view;
    }
}




Java Source Code List

codemonkey800.org.baseconverter.BaseConverterTest.java
codemonkey800.org.baseconverter.activities.BaseActivity.java
codemonkey800.org.baseconverter.activities.MainActivity.java
codemonkey800.org.baseconverter.adapters.NavigationDrawerAdapter.java
codemonkey800.org.baseconverter.fragments.ArbitraryBaseConverterFragment.java
codemonkey800.org.baseconverter.fragments.BaseConverterFragment.java
codemonkey800.org.baseconverter.fragments.BinaryConverterFragment.java
codemonkey800.org.baseconverter.fragments.DecimalConverterFragment.java
codemonkey800.org.baseconverter.fragments.HexadecimalConverterFragment.java
codemonkey800.org.baseconverter.models.BaseConverter.java
codemonkey800.org.baseconverter.models.NavigationDrawerListItem.java