Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This screen just serves as confirmation that the report was successful
- *
- * Created by marc on 2014/09/05.
- */
- object ReportAbuseConfirmedFragment {
- /** where we store the report's reference number */
- final val EXTRA_REFERENCE: String = "report_reference"
- def apply(reference: String)(implicit context: Context) = {
- val args = new Bundle()
- args.putString(EXTRA_REFERENCE, reference)
- args.putString(BaseFragment.EXTRA_FRAGMENT_TITLE, context.getString(R.string.report_abuse))
- val fragment = new ReportAbuseConfirmedFragment()
- fragment.setArguments(args)
- fragment
- }
- }
- class ReportAbuseConfirmedFragment extends MBaseFragment {
- var reportReference: String = _
- override def onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View = {
- implicit val view = inflater.inflate(R.layout.profile_abuse_report_confirmed_fragment, container, false)
- // try get the report reference that this fragment SHOULD ALWAYS be initialized with if this value is not here it was not initialized correctly
- reportReference = getArguments.getString(ReportAbuseConfirmedFragment.EXTRA_REFERENCE)
- // set the text to include the reference number
- MTextView(R.id.txtReportReference).text = getString(R.string.user_reported_reference, reportReference)
- // set the onClick listener of the OK button
- MButton(R.id.btn_ok).onClick = v => {
- v.setEnabled(false)
- mActivity.getSupportFragmentManager.popBackStack()
- }
- view
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement