-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from hyperrail/development
Version 4 (0.9.2)
- Loading branch information
Showing
34 changed files
with
267 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
68 changes: 68 additions & 0 deletions
68
Hyperrail/src/main/java/be/hyperrail/android/FeedbackFragment.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package be.hyperrail.android; | ||
|
||
import android.app.Fragment; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.pm.PackageInfo; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.EditText; | ||
|
||
/** | ||
* A simple {@link Fragment} subclass. | ||
*/ | ||
public class FeedbackFragment extends Fragment { | ||
|
||
public FeedbackFragment() { | ||
// Required empty public constructor | ||
} | ||
|
||
public static FeedbackFragment newInstance() { | ||
return new FeedbackFragment(); | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState) { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_feedback, container, false); | ||
} | ||
|
||
@Override | ||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
super.onViewCreated(view, savedInstanceState); | ||
final EditText vFeedbackText = ((EditText) view.findViewById(R.id.input_text)); | ||
|
||
view.findViewById(R.id.button_send).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
Context context = FeedbackFragment.this.getActivity(); | ||
String version = "unknown"; | ||
|
||
try { | ||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); | ||
version = pInfo.versionName; | ||
} catch (Exception e) { | ||
// Ignored | ||
} | ||
|
||
Intent feedbackEmail = new Intent(Intent.ACTION_SEND); | ||
|
||
feedbackEmail.setType("text/email"); | ||
feedbackEmail.putExtra(Intent.EXTRA_EMAIL, new String[]{"feedback@hyperrail.be"}); | ||
feedbackEmail.putExtra(Intent.EXTRA_SUBJECT, "Feedback for hyperrail " + version); | ||
feedbackEmail.putExtra(Intent.EXTRA_TEXT, vFeedbackText.getText()); | ||
startActivity(Intent.createChooser(feedbackEmail, "Send feedback mail:")); | ||
} | ||
}); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.