Example usage for android.widget LinearLayout setOnClickListener

List of usage examples for android.widget LinearLayout setOnClickListener

Introduction

In this page you can find the example usage for android.widget LinearLayout setOnClickListener.

Prototype

public void setOnClickListener(@Nullable OnClickListener l) 

Source Link

Document

Register a callback to be invoked when this view is clicked.

Usage

From source file:com.geekytheory.miguelcatalandev.developerdays.Main_Fragment_Places.java

private void initialize() {
    LinearLayout talks = (LinearLayout) getView().findViewById(R.id.places_linearlayout_talks);
    talks.setOnClickListener(this);
    LinearLayout hack = (LinearLayout) getView().findViewById(R.id.places_linearlayout_hackathon);
    hack.setOnClickListener(this);
    LinearLayout lunch = (LinearLayout) getView().findViewById(R.id.places_linearlayout_lunch);
    lunch.setOnClickListener(this);
    LinearLayout parking = (LinearLayout) getView().findViewById(R.id.places_linearlayout_parking);
    parking.setOnClickListener(this);
    ImageView image = (ImageView) getView().findViewById(R.id.places_imageview_map);
    image.setOnClickListener(this);

}

From source file:com.jakting.opengapps.AboutFragment.java

private void findSoManyId() {
    LinearLayout developersView = (LinearLayout) getActivity().findViewById(R.id.developersView);
    developersView.setOnClickListener(this);
    LinearLayout licensesView = (LinearLayout) getActivity().findViewById(R.id.licensesView);
    licensesView.setOnClickListener(this);
    LinearLayout sourceCodeView = (LinearLayout) getActivity().findViewById(R.id.sourceCodeView);
    sourceCodeView.setOnClickListener(this);
    LinearLayout langView = (LinearLayout) getActivity().findViewById(R.id.langView);
    langView.setOnClickListener(this);
}

From source file:com.clevertrail.mobile.Activity_MainMenu.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mActivity = this;

    TitleBar.setCustomTitleBar(this, R.layout.mainmenu, getString(R.string.app_name), 0);

    //register all the events for clicking on the different menu options
    LinearLayout llFindTrailsLocation = (LinearLayout) findViewById(R.id.mainmenu_findtrails_location);
    llFindTrailsLocation.setOnClickListener(onclickFindTrailsLocation);

    LinearLayout llFindTrailsName = (LinearLayout) findViewById(R.id.mainmenu_findtrails_name);
    llFindTrailsName.setOnClickListener(onclickFindTrailsName);

    LinearLayout llSavedTrail = (LinearLayout) findViewById(R.id.mainmenu_savedtrails);
    llSavedTrail.setOnClickListener(onclickSavedTrails);

    LinearLayout llAboutClevertrail = (LinearLayout) findViewById(R.id.mainmenu_about);
    llAboutClevertrail.setOnClickListener(onclickAboutClevertrail);
}

From source file:cheng.app.cnbeta.AboutFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    PackageManager pm = getActivity().getPackageManager();
    String packageName = getActivity().getPackageName();
    String versionName;/*  w w w. j  a  va 2  s  .  c om*/
    try {
        PackageInfo info = pm.getPackageInfo(packageName, 0);
        versionName = info.versionName;
    } catch (NameNotFoundException e) {
        versionName = VERSION_NA;
    }

    LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
    View v = layoutInflater.inflate(R.layout.dialog_about, null);
    TextView versionText = (TextView) v.findViewById(R.id.dialog_about_version);
    LinearLayout author = (LinearLayout) v.findViewById(R.id.author);
    versionText.setText(versionName);
    author.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent i = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://plus.google.com/u/0/114474183775310756510"));
            startActivity(i);
        }
    });
    TextView github = (TextView) v.findViewById(R.id.github);
    github.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/cr1944/CBReader2"));
            startActivity(i);
        }
    });
    TextView opensource = (TextView) v.findViewById(R.id.opensource);
    opensource.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            HelpUtils.showOpenSourceLicenses(getActivity());
        }
    });

    return new AlertDialog.Builder(getActivity()).setView(v)
            .setPositiveButton(android.R.string.cancel, new OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();

                }
            }).create();
}

From source file:org.gluu.super_gluu.app.fragments.LicenseFragment.LicenseFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.license_fragment, container, false);
    WebView licenseWebView = (WebView) view.findViewById(R.id.license_webView);
    licenseWebView.loadDataWithBaseURL(null, readLicenseTxt(), "text/html", "UTF-8", null);
    //        licenseTextView.setMovementMethod(new ScrollingMovementMethod());

    Button aceptButton = (Button) view.findViewById(R.id.accept_button);
    LinearLayout action_left_button = (LinearLayout) view.findViewById(R.id.action_left_button);
    action_left_button.setOnClickListener(new View.OnClickListener() {
        @Override/*w  w w  . j a  v  a2  s. co  m*/
        public void onClick(View v) {
            getActivity().onBackPressed();
        }
    });
    aceptButton.setOnClickListener(this);
    LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) licenseWebView.getLayoutParams();
    if (!isForFirstLoading) {
        aceptButton.setVisibility(View.GONE);
        action_left_button.setVisibility(View.VISIBLE);
        params.weight = 0.25f;
    } else {
        action_left_button.setVisibility(View.GONE);
        params.weight = 0.98f;
    }
    licenseWebView.setLayoutParams(params);
    //Setup fonts
    Typeface face = Typeface.createFromAsset(getActivity().getAssets(), "ProximaNova-Regular.otf");
    aceptButton.setTypeface(face);

    return view;
}

From source file:com.prey.activities.DeviceReadyActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

    setContentView(R.layout.device_ready);

    PreyLogger.d("onCreate of DeviceReadyActivity");

    final Typeface titilliumWebBold = Typeface.createFromAsset(getAssets(),
            "fonts/Titillium_Web/TitilliumWeb-Bold.ttf");
    final Typeface magdacleanmonoRegular = Typeface.createFromAsset(getAssets(),
            "fonts/MagdaClean/magdacleanmono-regular.ttf");

    TextView textView3_1 = (TextView) findViewById(R.id.textView3_1);
    TextView textView3_2 = (TextView) findViewById(R.id.textView3_2);
    TextView textView4_1 = (TextView) findViewById(R.id.textView4_1);
    TextView textView4_2 = (TextView) findViewById(R.id.textView4_2);

    textView3_1.setTypeface(magdacleanmonoRegular);
    textView3_2.setTypeface(titilliumWebBold);
    textView4_1.setTypeface(magdacleanmonoRegular);
    textView4_2.setTypeface(titilliumWebBold);

    LinearLayout linearLayout1 = (LinearLayout) findViewById(R.id.linearLayout1);
    linearLayout1.setOnClickListener(new View.OnClickListener() {
        @Override//from  w  w w .j  av a  2s  .c o  m
        public void onClick(View v) {
            Intent intent = null;

            intent = new Intent(getApplication(), PanelWebActivity.class);

            startActivity(intent);
            finish();
        }
    });

    LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.linearLayout2);
    linearLayout2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = null;

            intent = new Intent(getApplication(), PreyConfigurationActivity.class);

            startActivity(intent);
            finish();
        }
    });

}

From source file:au.com.wallaceit.reddinator.SimpleTabsWidget.java

private void insertTab(int index, String text) {

    TabClickListener clickListener = new TabClickListener(index);
    LinearLayout tabContainer = (LinearLayout) inflater.inflate(R.layout.tab, tabWidget, false);
    tabContainer.setOnClickListener(clickListener);

    TextView tabText = (TextView) tabContainer.findViewById(R.id.tab_text);
    tabText.setText(text);/*from ww w  .  j a va  2s  .com*/
    tabText.setTextColor(colors[0]);
    tabItems.add(tabText);

    LinearLayout indicator = (LinearLayout) tabContainer.findViewById(R.id.tab_indicator);
    indicator.setBackgroundColor(colors[1]);
    indicatorItems.add(indicator);

    tabContainer.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT, 1));
    tabWidget.addView(tabContainer);
}

From source file:org.tomahawk.tomahawk_android.dialogs.ChooseUserPlaylistDialog.java

/**
 * Called when this {@link DialogFragment} is being created
 *///from   w w  w .  j av  a  2  s . c om
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.choose_playlist_dialog, null);

    // Get all query keys from this fragment's arguments and through get the actual queries.
    final ArrayList<Query> queries = new ArrayList<Query>();
    if (getArguments() != null && getArguments().containsKey(TomahawkFragment.TOMAHAWK_QUERYKEYSARRAY_KEY)) {
        ArrayList<String> queryKeys = getArguments()
                .getStringArrayList(TomahawkFragment.TOMAHAWK_QUERYKEYSARRAY_KEY);
        if (queryKeys != null) {
            for (String queryKey : queryKeys) {
                queries.add(Query.getQueryByKey(queryKey));
            }
        }
    }

    ListView listView = (ListView) view.findViewById(R.id.playlist_dialog_playlists_listview);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            DatabaseHelper.getInstance().addQueriesToUserPlaylist(
                    CollectionManager.getInstance().getLocalUserPlaylists().get(position).getId(), queries);
            getDialog().dismiss();
        }
    });
    int customPlaylistCount = CollectionManager.getInstance().getLocalUserPlaylists().size();
    List<String> playlistNames = new ArrayList<String>();
    for (int i = 0; i < customPlaylistCount; i++) {
        playlistNames.add(CollectionManager.getInstance().getLocalUserPlaylists().get(i).getName());
    }
    listView.setAdapter(
            new TomahawkContextMenuAdapter(getActivity(), getActivity().getLayoutInflater(), playlistNames));
    LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.playlist_dialog_addplaylist_layout);
    linearLayout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            UserPlaylist userPlaylist = UserPlaylist
                    .fromQueryList(TomahawkMainActivity.getLifetimeUniqueStringId(), "", queries);
            CreateUserPlaylistDialog dialog = new CreateUserPlaylistDialog();
            Bundle args = new Bundle();
            args.putString(TomahawkFragment.TOMAHAWK_USERPLAYLIST_KEY, userPlaylist.getId());
            dialog.setArguments(args);
            dialog.show(getFragmentManager(), null);
            getDialog().dismiss();
        }
    });
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(view);
    return builder.create();
}

From source file:org.openoverlayrouter.noroot.logActivity.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    faActivity = (FragmentActivity) super.getActivity();
    llLayout = (LinearLayout) inflater.inflate(R.layout.log, container, false);

    File sdcardDir = Environment.getExternalStorageDirectory();
    log_file = new File(sdcardDir, "oor.log");

    LinearLayout refreshButton = (LinearLayout) llLayout.findViewById(R.id.linearbutton);

    refreshButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            refreshClicked(llLayout);/*  w  ww. ja  va  2s .  co  m*/
        }
    });

    new Thread(new Runnable() {
        public void run() {
            refresh();
        }
    }).start();

    return llLayout;
}

From source file:com.alex.vmandroid.display.main.fragments.DiscoverFragment.java

@Nullable
@Override/* w w  w .j a  v  a  2  s  .  co  m*/
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    Log.i(TAG, "onCreateView: DiscoverFragment");

    View view = inflater.inflate(R.layout.fragment_main_discover, container, false);

    LoopAdvertisementFragment fragment = new LoopAdvertisementFragment();

    FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
    new LoopAdvertisementPresenter(fragment);
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    transaction.replace(R.id.main_loop_advertisement_frame_layout, fragment);
    transaction.commit();

    LinearLayout mBarLinearLayout = (LinearLayout) view.findViewById(R.id.main_discover_bar_ll);
    mBarLinearLayout.setOnClickListener(this);

    LinearLayout mKTVLinearLayout = (LinearLayout) view.findViewById(R.id.main_discover_ktv_ll);
    mKTVLinearLayout.setOnClickListener(this);

    LinearLayout mRestaurantLinearLayout = (LinearLayout) view.findViewById(R.id.main_discover_restaurant_ll);
    mRestaurantLinearLayout.setOnClickListener(this);

    LinearLayout mOtherLinearLayout = (LinearLayout) view.findViewById(R.id.main_discover_other_ll);
    mOtherLinearLayout.setOnClickListener(this);

    // TODO ?
    ShareFragment shareFragment = new ShareFragment();
    FragmentManager fragmentManager2 = getActivity().getSupportFragmentManager();
    new SharePresenter(shareFragment, getActivity());
    FragmentTransaction transaction2 = fragmentManager2.beginTransaction();
    transaction2.replace(R.id.main_share_frame_layout, shareFragment);
    transaction2.commit();

    return view;
}