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
res \ values \ strings.xml: | |
<resources> | |
<string name="app_name">Menu Example</string> | |
<string name="file">File</string> | |
<string name="edit">Edit</string> | |
<string name="view">View</string> | |
<string name="navigate">Navigate</string> | |
</resources> |
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
layout\my_item.xml: | |
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:fontFamily="casual" | |
android:padding="10dp" | |
android:textColor="@color/pink" | |
android:textSize="30sp" | |
android:textStyle="bold" /> |
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
AndroidManifest.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<application | |
... | |
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar" | |
... |
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
activity_main.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> |
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
package com.sunmeat.myapplication; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.Toast; | |
import androidx.appcompat.app.AppCompatActivity; | |
public class MainActivity extends AppCompatActivity { |
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
SELECT | |
DB_NAME(database_id) AS DatabaseName, | |
SUM(size) * 8 AS SizeInBytes | |
FROM | |
sys.master_files | |
WHERE | |
database_id > 4 | |
GROUP BY | |
database_id | |
ORDER BY |
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
// Интерфейсы, описывающие абстрактное поведение | |
interface IFlyBehavior | |
{ | |
void Fly(); | |
} | |
interface IQuackBehavior | |
{ | |
void Quack(); |
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
interface IChief | |
{ | |
object MakeBreakfast(); | |
object MakeLunch(); | |
object MakeDinner(); | |
} | |
class ScrewNut { } | |
class Pipe { } |
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
class SkiRent // аренда снаряжения | |
{ | |
public double RentBoots(int feetSize, int skierLevel) // ботинки | |
{ | |
double price = 159.99; | |
// if (feetSize < 40) price -= 20; // скидка для детей | |
return price; | |
} |
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
// Абстрактный класс для продуктов-диалогов | |
abstract class Dialog | |
{ | |
public abstract void Render(); | |
public abstract void Click(); | |
} | |
// Конкретный продукт диалога для Windows | |
class WindowsDialog : Dialog | |
{ |