Skip to content

Instantly share code, notes, and snippets.

View Eng-MFQ's full-sized avatar
🏠
Working from home

Muwaffaq imam Eng-MFQ

🏠
Working from home
View GitHub Profile
@Eng-MFQ
Eng-MFQ / happy_birthday.xml
Created February 13, 2018 12:07
Level 1 Project
<!-- To download the Images and Project Mockup use links below -->
<!-- https://www.dropbox.com/sh/kq966uzv9cmq85u/AAB2bs7mQjFcOd6O8nElGHN1a?dl=0 -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
@Eng-MFQ
Eng-MFQ / MainActivity.java
Created February 13, 2018 14:31
Level 2 start app
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
/**
* This app displays an order form to order coffee.
*/
public class MainActivity extends AppCompatActivity {
@Eng-MFQ
Eng-MFQ / displayPrice
Created February 13, 2018 15:30
Method For adding text to TextView
/**
* This method displays the given price on the screen.
*/
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
/**
* This method displays the given text on the screen.
*/
private void displayMessage(String message) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(message);
}
/**
* Displays the given score for Team A.
*/
public void displayForTeamA(int score) {
TextView scoreView = (TextView) findViewById(R.id.team_a_score);
scoreView.setText(String.valueOf(score));
}
/**
* Displays the given score for Team B.
*/
public void displayForTeamB(int score) {
TextView scoreView = (TextView) findViewById(R.id.team_b_score);
scoreView.setText(String.valueOf(score));
}
public void openNumberActivity(){
Intent intent = new Intent(this, NumbersActivity.class);
startActivity(intent);
}
/**
* Clean up the media player by releasing its resources.
*/
private void releaseMediaPlayer() {
// If the media player is not null, then it may be currently playing a sound.
if (mMediaPlayer != null) {
// Regardless of the current state of the media player, release its resources
// because we no longer need it.
mMediaPlayer.release();
@Eng-MFQ
Eng-MFQ / FlutterStarterTemplate.dart
Last active December 25, 2018 11:43
Flutter starter template for students to start building UI , and NOT get confused with the code
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@Eng-MFQ
Eng-MFQ / FlutterStarterColumn
Last active January 23, 2022 08:13
a flutter app starter template with column layout written
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// this is your APP Main screen configuration
class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {