Materializing
This commit is contained in:
parent
4ddc3812cb
commit
9e6d755e45
66 changed files with 740 additions and 3281 deletions
app/src/main/java/de/marcelkapfer/morseconverter
|
@ -1,110 +0,0 @@
|
|||
/*
|
||||
* This is a Android application for converting writtenMorse and normal morse code.
|
||||
* Copyright (C) 2014-2015 Marcel Michael Kapfer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Marcel Michael Kapfer
|
||||
* marcelmichaelkapfer@yahoo.co.nz
|
||||
*
|
||||
* Version 1.0.1
|
||||
*/
|
||||
|
||||
package de.marcelkapfer.morseconverter;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
|
||||
public class DisplayMessageActivity extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Get the message from the intent
|
||||
Intent intent = getIntent();
|
||||
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
|
||||
|
||||
// Create the text view
|
||||
TextView textView = new TextView(this);
|
||||
textView.setTextSize(20);
|
||||
textView.setText(message);
|
||||
textView.setTextIsSelectable(true);
|
||||
textView.setPadding(10, 10, 10, 10);
|
||||
|
||||
|
||||
// Set the text view as the activity layout
|
||||
setContentView(textView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu items for use in the action bar
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.display_message_activity_actions, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle presses on the action bar items
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_share:
|
||||
share();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A placeholder fragment containing a simple view.
|
||||
*/
|
||||
public static class PlaceholderFragment extends Fragment {
|
||||
|
||||
public PlaceholderFragment() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.fragment_display_message,
|
||||
container, false);
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void share(){
|
||||
Intent intent = getIntent();
|
||||
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
|
||||
Intent sendIntent = new Intent();
|
||||
sendIntent.setAction(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
|
||||
sendIntent.setType("text/plain");
|
||||
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,17 @@
|
|||
package de.marcelkapfer.morseconverter;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* Created by mmk on 2/14/15.
|
||||
*/
|
||||
public class MainFragment extends Fragment{
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
|
||||
return inflater.inflate(R.layout.fragment_main, container, false);
|
||||
}
|
||||
}
|
Reference in a new issue