Back to project page android-wav-mixer.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2014 Nathan Sizemore <nathanrsizemore@gmail.com> Everyone is permitted to copy and distribute verbatim or modified ...
If you think the Android project android-wav-mixer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nathansizemore.beatmaker.fragments; /* w ww . j a va 2 s . c om*/ import android.app.Activity; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import com.example.beatmaker.R; import com.nathansizemore.beatmaker.audiomixer.Sample; import com.nathansizemore.beatmaker.fragments.interfaces.SampleSelect; public class MainClipSelect extends Fragment { private Button bass; private Button bassSynth; private Button drums; private Button piano; private SampleSelect sendEvent; public MainClipSelect() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_clip_select, container, false); setOnClicks(rootView); return rootView; } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { sendEvent = (SampleSelect)activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement SampleSelect"); } } private void setOnClicks(View view) { bass = (Button)(view.findViewById(R.id.bass_button)); bassSynth = (Button)(view.findViewById(R.id.bass_synth_button)); drums = (Button)(view.findViewById(R.id.drums_button)); piano = (Button)(view.findViewById(R.id.piano_button)); bass.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendEvent.onSampleSelect(Sample.Bass); } }); bassSynth.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendEvent.onSampleSelect(Sample.BassSynth); } }); drums.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendEvent.onSampleSelect(Sample.Drums); } }); piano.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendEvent.onSampleSelect(Sample.Piano); } }); } }