This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 2. Set title with collapsing toolbar*/ | |
| CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsingToolbar); | |
| collapsingToolbar.setTitle("Collapsing Toolbar"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Declare media recorder object and output file as member variable | |
| private MediaRecorder myAudioRecorder; | |
| private String output; | |
| // Create a folder on the file system | |
| File folder = new File(Environment.getExternalStorageDirectory() + | |
| File.separator + "Folder Name"); | |
| boolean success = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MainActivity extends AppCompatActivity implements OnMapReadyCallback { | |
| //static final LatLng latLong = new LatLng(21 , 57); | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create async task | |
| MySumTask mySumTask = new MySumTask(); | |
| // Start async task | |
| mySumTask.execute(10); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.support.annotation.NonNull; | |
| import android.support.design.widget.Snackbar; | |
| import android.support.v4.app.FragmentActivity; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.ImageView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.support.design.widget.CoordinatorLayout; | |
| import android.support.design.widget.FloatingActionButton; | |
| import android.support.v4.view.ViewCompat; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| /** | |
| * Created by ADMIN on 9/22/2016. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void setupRecyclerView(View view) { | |
| RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view_my_words); | |
| RecyclerAdapter recyclerAdapter = new RecyclerAdapter(getActivity(), myDatabase.getAllWords()); | |
| recyclerView.setAdapter(recyclerAdapter); | |
| LinearLayoutManager linearLayoutManager= new LinearLayoutManager(getActivity()); | |
| linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); | |
| recyclerView.setLayoutManager(linearLayoutManager); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static final int REQ_CODE = 1; | |
| @Override | |
| public void onClick(View v) { | |
| Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); | |
| intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); | |
| intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MainActivity extends AppCompatActivity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| initializeScreen(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Declare and initialize | |
| TextInputLayout textInputLayout = (TextInputLayout) view.findViewById(R.id.input_layout_name); | |
| // If error | |
| textInputLayout.setError("Username and password must be greater an 5 characters"); | |
| // If no error | |
| textInputLayout.setErrorEnabled(false); |
NewerOlder