commit ff881dc2e6eb5de2e5219c86b995887ed579a4af Author: Lutfi Date: Thu Jul 10 16:51:57 2025 +0700 android aplication for jemuran pintar diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..f48317d --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +ESP32 \ No newline at end of file diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml new file mode 100644 index 0000000..d270469 --- /dev/null +++ b/.idea/appInsightsSettings.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..9a7c4df --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,48 @@ +plugins { + id("com.android.application") + id("com.google.gms.google-services") +} + +android { + namespace = "com.example.esp32" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.esp32" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + implementation(libs.firebase.database) + implementation(libs.firebase.auth) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) + implementation(platform("com.google.firebase:firebase-bom:33.1.2")) + +} \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..b421516 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,30 @@ +{ + "project_info": { + "project_number": "7395556180", + "firebase_url": "https://esp32-86fe1-default-rtdb.asia-southeast1.firebasedatabase.app", + "project_id": "esp32-86fe1", + "storage_bucket": "esp32-86fe1.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:7395556180:android:90a8bb38059eb6b2e266c1", + "android_client_info": { + "package_name": "com.example.esp32" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDVxD4YAqjoxLrw47y7Oo0W8It8kjj_sFI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/esp32/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/esp32/ExampleInstrumentedTest.java new file mode 100644 index 0000000..ebd454a --- /dev/null +++ b/app/src/androidTest/java/com/example/esp32/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.esp32; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.esp32", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b9d65f1 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/esp32/MainActivity.java b/app/src/main/java/com/example/esp32/MainActivity.java new file mode 100644 index 0000000..7066598 --- /dev/null +++ b/app/src/main/java/com/example/esp32/MainActivity.java @@ -0,0 +1,277 @@ +package com.example.esp32; + +import android.app.Dialog; +import android.content.Intent; +import android.os.Bundle; +import android.os.CountDownTimer; +import android.view.View; +import android.widget.Button; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.Switch; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.auth.AuthResult; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +public class MainActivity extends AppCompatActivity { + + FirebaseAuth firebaseAuth; + DatabaseReference databaseReference; + private TextView tvStatus, tvSecond, tvWeather, tvLight, tvPosition; + private Switch btnSwitch; + private Button btnAdd, btnReset, btnStart, btnWeather; + private int timeSelected = 0; + private CountDownTimer timeCountDown = null; + private int timeProgress = 0; + private long pauseOffSet = 0; + private boolean isStart = true; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + tvStatus = findViewById(R.id.tv_status); + tvSecond = findViewById(R.id.tv_second); + tvWeather = findViewById(R.id.tv_weatherStatus); + tvLight = findViewById(R.id.tv_lightStatus); + tvPosition = findViewById(R.id.tv_position); + btnSwitch = findViewById(R.id.btn_switch); + btnAdd = findViewById(R.id.btn_add); + btnReset = findViewById(R.id.btn_reset); + btnStart = findViewById(R.id.btn_start); + btnWeather = findViewById(R.id.btn_weather); + + firebaseAuth = FirebaseAuth.getInstance(); + + String email = "lutfi@gmail.com"; + String password = "1234567"; + + firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if (task.isSuccessful()) { + Toast.makeText(MainActivity.this, "Login succes", Toast.LENGTH_SHORT).show(); + + } else { + Toast.makeText(MainActivity.this, "Email atau Password Salah ", Toast.LENGTH_SHORT).show(); + } + } + }); + + btnSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { + if(isChecked){ + tvStatus.setText("Status : On"); + setOnOff("On"); + } + else { + tvStatus.setText("Status : Off"); + setOnOff("Off"); + } + } + }); + + btnAdd.setOnClickListener(view -> setTimeFunction()); + btnStart.setOnClickListener(view -> startTimerSetup()); + btnReset.setOnClickListener(view -> resetTime()); + + readDataSensor(); + readStatus(); + readPosition(); + + btnWeather.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + // Perintah Intent Explicit untuk berpindah ke SecondActivity + startActivity(new Intent(MainActivity.this, WeatherListActivity.class)); + finish(); + } + }); + } + + private void resetTime() { + if (timeCountDown != null) { + timeCountDown.cancel(); + timeProgress = 0; + timeSelected = 0; + pauseOffSet = 0; + timeCountDown = null; + btnStart.setText("Start"); + isStart = true; + tvSecond.setText("0"); + setOnOff("Off"); + } + } + private void timePause() { + if (timeCountDown != null) { + timeCountDown.cancel(); + } + } + + private void startTimerSetup() { + if (timeSelected > timeProgress) { + if (isStart) { + btnStart.setText("Pause"); + setOnOff("On"); + startTimer(pauseOffSet); + isStart = false; + } else { + isStart = true; + btnStart.setText("Resume"); + setOnOff("Off"); + timePause(); + } + } else { + Toast.makeText(this, "Enter Time", Toast.LENGTH_SHORT).show(); + } + } + + private void startTimer(long pauseOffSetL) { + timeCountDown = new CountDownTimer((timeSelected * 1000L) - pauseOffSetL * 1000, 1000) { + @Override + public void onTick(long millisUntilFinished) { + timeProgress++; + pauseOffSet = timeSelected - millisUntilFinished / 1000; + tvSecond.setText(String.valueOf(timeSelected - timeProgress)); + } + + @Override + public void onFinish() { + resetTime(); + tvStatus.setText("Status : Off"); + setOnOff("Off"); + Toast.makeText(MainActivity.this, "Times Up!", Toast.LENGTH_SHORT).show(); + } + }.start(); + } + + private void setTimeFunction() { + Dialog timeDialog = new Dialog(this); + timeDialog.setContentView(R.layout.add_dialog); + EditText timeSet = timeDialog.findViewById(R.id.et_gettime); + + timeDialog.findViewById(R.id.btn_ok).setOnClickListener(view -> { + if (timeSet.getText().toString().isEmpty()) { + Toast.makeText(this, "Enter Time Duration", Toast.LENGTH_SHORT).show(); + } else { + resetTime(); + tvSecond.setText(timeSet.getText().toString()); + btnStart.setText("Start"); + timeSelected = Integer.parseInt(timeSet.getText().toString()); + } + timeDialog.dismiss(); + }); + timeDialog.show(); + } + + private void setOnOff(String state) { + databaseReference = FirebaseDatabase.getInstance().getReference("status").child("value"); + databaseReference.setValue(state).addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if (task.isSuccessful()) { + tvStatus.setText("Status : "+state); + } else { + Toast.makeText(MainActivity.this, "Failed to update status", Toast.LENGTH_SHORT).show(); + } + } + }); + } + + private void readStatus(){ + databaseReference = FirebaseDatabase.getInstance().getReference("status"); + databaseReference.addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + if (snapshot.exists()) { + String statusValue = String.valueOf(snapshot.child("value").getValue()); + if ("On".equalsIgnoreCase(statusValue)) { + btnSwitch.setChecked(true); + } else if ("Off".equalsIgnoreCase(statusValue)) { + btnSwitch.setChecked(false); + } + } else { + Toast.makeText(MainActivity.this, "Data does not exist", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + Toast.makeText(MainActivity.this, "Failed to read data: " + error.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + + private void readPosition(){ + databaseReference = FirebaseDatabase.getInstance().getReference("position"); + databaseReference.addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + if (snapshot.exists()) { + String positionValue = String.valueOf(snapshot.child("value").getValue()); + if ("0".equalsIgnoreCase(positionValue)) { + tvPosition.setText("Outside"); + } else if ("1".equalsIgnoreCase(positionValue)) { + tvPosition.setText("Onside"); + } + } else { + Toast.makeText(MainActivity.this, "Data does not exist", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + Toast.makeText(MainActivity.this, "Failed to read data: " + error.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + + private void readDataSensor() { + databaseReference = FirebaseDatabase.getInstance().getReference("sensor"); + databaseReference.addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + if (snapshot.exists()) { + String ldrValue = String.valueOf(snapshot.child("ldr").getValue()); + String rdValue = String.valueOf(snapshot.child("rd").getValue()); + if ("1".equalsIgnoreCase(ldrValue) && "1".equalsIgnoreCase(rdValue)){ + tvLight.setText("Overcast"); + tvWeather.setText("Cloudy"); + } else if ("0".equalsIgnoreCase(rdValue) && "0".equalsIgnoreCase(ldrValue)) { + tvLight.setText("Good"); + tvWeather.setText("Rainy"); + } else if ("0".equalsIgnoreCase(rdValue) && "1".equalsIgnoreCase(ldrValue)) { + tvLight.setText("Overcast"); + tvWeather.setText("Rainy"); + } else { + tvLight.setText("Good"); + tvWeather.setText("Sunny"); + } + + } else { + Toast.makeText(MainActivity.this, "Data does not exist", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + Toast.makeText(MainActivity.this, "Failed to read data: " + error.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + +} diff --git a/app/src/main/java/com/example/esp32/MyAdapter.java b/app/src/main/java/com/example/esp32/MyAdapter.java new file mode 100644 index 0000000..bd24e94 --- /dev/null +++ b/app/src/main/java/com/example/esp32/MyAdapter.java @@ -0,0 +1,84 @@ +package com.example.esp32; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; + +public class MyAdapter extends RecyclerView.Adapter { + Context context; + ArrayList list; + private String lastDate = ""; + + public MyAdapter(Context context, ArrayList list) { + this.context = context; + this.list = list; + } + + @NonNull + @Override + public MyAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View v = LayoutInflater.from(context).inflate(R.layout.weather_entry, parent, false); + return new MyViewHolder(v); + } + + @Override + public void onBindViewHolder(@NonNull MyAdapter.MyViewHolder holder, int position) { + holder.itemView.setPadding(0, 0, 0, 0); + Weather weather = list.get(position); + + if (!weather.getTanggal().equals(lastDate)) { + holder.date.setVisibility(View.VISIBLE); + holder.date.setText(weather.getTanggal()); + lastDate = weather.getTanggal(); + } else { + holder.date.setVisibility(View.GONE); + } + + String ldrValue = String.valueOf(weather.getLdr()); + String rdValue = String.valueOf(weather.getRd()); + String lightText; + String weatherText; + + if ("1".equalsIgnoreCase(ldrValue) && "1".equalsIgnoreCase(rdValue)){ + lightText = "Overcast"; + weatherText = "Cloudy"; + } else if ("0".equalsIgnoreCase(rdValue) && "0".equalsIgnoreCase(ldrValue)) { + lightText = "Good"; + weatherText = "Rainy"; + } else if ("0".equalsIgnoreCase(rdValue) && "1".equalsIgnoreCase(ldrValue)) { + lightText = "Overcast"; + weatherText = "Rainy"; + } else { + lightText = "Good"; + weatherText = "Sunny"; + } + + holder.light.setText(lightText); + holder.weather.setText(weatherText); + holder.time.setText(weather.getJam()); + } + + @Override + public int getItemCount() { + return list.size(); + } + + public static class MyViewHolder extends RecyclerView.ViewHolder { + TextView date, weather, light, time; + + public MyViewHolder(@NonNull View itemView) { + super(itemView); + date = itemView.findViewById(R.id.tv_list_tanggal); + weather = itemView.findViewById(R.id.tv_list_weather); + light = itemView.findViewById(R.id.tv_list_light); + time = itemView.findViewById(R.id.tv_list_time); + } + } +} diff --git a/app/src/main/java/com/example/esp32/Weather.java b/app/src/main/java/com/example/esp32/Weather.java new file mode 100644 index 0000000..c135bac --- /dev/null +++ b/app/src/main/java/com/example/esp32/Weather.java @@ -0,0 +1,37 @@ +package com.example.esp32; + +import com.google.firebase.database.IgnoreExtraProperties; + +@IgnoreExtraProperties +public class Weather { + private String tanggal; + private String jam; + private int ldr; + private int rd; + + public Weather() { + } + + public Weather(String tanggal, String jam, int ldr, int rd) { + this.tanggal = tanggal; + this.jam = jam; + this.ldr = ldr; + this.rd = rd; + } + + public String getTanggal() { + return tanggal; + } + + public String getJam() { + return jam; + } + + public int getLdr() { + return ldr; + } + + public int getRd() { + return rd; + } +} diff --git a/app/src/main/java/com/example/esp32/WeatherListActivity.java b/app/src/main/java/com/example/esp32/WeatherListActivity.java new file mode 100644 index 0000000..18c19ca --- /dev/null +++ b/app/src/main/java/com/example/esp32/WeatherListActivity.java @@ -0,0 +1,80 @@ +package com.example.esp32; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.auth.AuthResult; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; + +public class WeatherListActivity extends AppCompatActivity { + RecyclerView recyclerView; + ArrayList list; + DatabaseReference databaseReference; + MyAdapter adapter; + Button btnMonitor; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_weather_list); + + btnMonitor = findViewById(R.id.btn_monitor); + + recyclerView = findViewById(R.id.rv_weather); + databaseReference = FirebaseDatabase.getInstance().getReference("weather"); + list = new ArrayList<>(); + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + recyclerView.setHasFixedSize(true); + recyclerView.setItemAnimator(null); + adapter = new MyAdapter(this, list); + recyclerView.setAdapter(adapter); + + databaseReference.addValueEventListener(new ValueEventListener() { + + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + list.clear(); + for(DataSnapshot dataSnapshot: snapshot.getChildren()){ + Weather weather = dataSnapshot.getValue(Weather.class); + list.add(weather); + } + adapter.notifyDataSetChanged(); + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + + } + }); + + btnMonitor.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(new Intent(WeatherListActivity.this, MainActivity.class)); + finish(); + } + }); + + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..35c3d3c --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +