sunnnl

스플래시 오류, 토글 커스텀 완료

......@@ -14,23 +14,21 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".ui.VideoCheckActivity"></activity>
<activity android:name=".ui.VideoPlayerActivity"></activity>
<activity android:name=".ui.VideoCheckActivity" />
<activity android:name=".ui.DeviceManagerActivity" />
<activity android:name=".ui.RemoteControlRecordActivity" />
<activity
android:name=".ui.SplashActivity"
android:noHistory="true"
android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.MainActivity">
</activity>
<activity android:name=".ui.MainActivity"></activity>
<activity android:name=".ui.SettingActivity" />
</application>
......
......@@ -38,14 +38,14 @@ public class VideoCheckActivity extends AppCompatActivity {
Toolbar mToolbar = findViewById(R.id.toolbar_video_check);
setToolbar(mToolbar);
mBtnRemoveVideo = (Button) findViewById(R.id.btn_remove_video);
mBtnViewVideo = (Button) findViewById(R.id.btn_view_video);
// mBtnRemoveVideo = (Button) findViewById(R.id.btn_remove_video);
// mBtnViewVideo = (Button) findViewById(R.id.btn_view_video);
getVideos();
init();
setRecyclerView();
mBtnRemoveVideo.setOnClickListener(new View.OnClickListener() {
/*mBtnRemoveVideo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO : 삭제 버튼이 클릭되었을 때
......@@ -93,7 +93,7 @@ public class VideoCheckActivity extends AppCompatActivity {
// TODO : 비디오 재생 코드 구현 (video.setS3link를 통해)
}
}
});
});*/
}
private void setToolbar(Toolbar toolbar) {
......
package com.sunnni.smartdoorlock.ui;
import androidx.appcompat.app.AppCompatActivity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
import com.sunnni.smartdoorlock.R;
public class VideoPlayerActivity extends AppCompatActivity {
VideoView mVideoView;
Uri videoUri;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_player);
mVideoView = findViewById(R.id.vv);
if (getIntent().getStringExtra("video_url").isEmpty()){
Toast.makeText(this, "링크 null", Toast.LENGTH_SHORT).show();
} else{
String url = getIntent().getStringExtra("video_url");
videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + url);
playVideo();
}
}
@Override
protected void onPause() {
super.onPause();
if(mVideoView!=null && mVideoView.isPlaying()) mVideoView.pause();
}
@Override
protected void onDestroy() {
super.onDestroy();
if(mVideoView!=null) mVideoView.stopPlayback();
}
private void playVideo(){
mVideoView.setMediaController(new MediaController(this));
mVideoView.setVideoURI(videoUri);
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mVideoView.start();
}
});
}
}
......@@ -99,7 +99,10 @@ public class VideoRvAdapter extends RecyclerView.Adapter<VideoRvAdapter.VideoVie
} else {
String s3link = (String) obj;
video.setS3link(s3link);
// TODO : 비디오 재생 코드 구현 (video.setS3link를 통해)
// 비디오 플레이어 액티비티로 url 넘겨서 플레이
Intent intent = new Intent(itemView.getContext(), VideoPlayerActivity.class);
intent.putExtra("video_url", video.getS3link());
itemView.getContext().startActivity(intent);
}
}
});
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_thumb_checked" android:state_checked="true" />
<item android:drawable="@drawable/bg_thumb_normal" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_track_checked" android:state_checked="true" />
<item android:drawable="@drawable/bg_track_normal" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#5c6bc0" />
<size
android:width="20dp"
android:height="20dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#999999" />
<size
android:width="20dp"
android:height="20dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#c5cae9" />
<corners android:radius="10dp" />
<size
android:width="28dp"
android:height="13dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#c5cae9" />
<corners android:radius="8.5dp" />
<size
android:width="28dp"
android:height="16dp" />
</shape>
......@@ -88,6 +88,8 @@
app:layout_constraintTop_toTopOf="parent" />
<Switch
android:thumb="@drawable/bg_default_switch_thumb"
android:track="@drawable/bg_default_switch_track"
android:id="@+id/swc_recording"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -39,18 +39,20 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="50dp"
android:hint="고유번호"
android:layout_marginEnd="3dp"
android:hint="고유번호 입력"
android:textColorHint="@color/colorAccent"
android:theme="@style/EditTextTheme"
android:visibility="invisible"
app:boxStrokeColor="@color/colorMainText"
app:boxStrokeWidth="1dp"
app:hintTextColor="@color/colorMainText"
app:layout_constraintDimensionRatio="75:35"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/cl_enter"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_logo"
app:layout_constraintWidth_default="percent"
android:layout_marginEnd="3dp"
app:layout_constraintWidth_percent="0.4">
<com.google.android.material.textfield.TextInputEditText
......@@ -70,17 +72,17 @@
android:id="@+id/cl_enter"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.15"
app:layout_constraintDimensionRatio="52:36"
android:layout_marginStart="10dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/til_super_key"
app:layout_constraintDimensionRatio="52:36"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_goneMarginStart="3dp"
app:layout_constraintStart_toEndOf="@+id/til_super_key"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/til_super_key"
app:layout_constraintBottom_toBottomOf="@id/til_super_key">
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.15"
app:layout_goneMarginStart="3dp">
<Button
android:id="@+id/btn_enter"
......
......@@ -82,21 +82,5 @@ tools:context=".ui.VideoCheckActivity">
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toBottomOf="@+id/img_icon_list" />
<Button
android:id="@+id/btn_remove_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn_remove_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/btn_view_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn_view_video"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:background="#000000"
tools:context=".ui.VideoPlayerActivity">
<VideoView
android:id="@+id/vv"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="80:51"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -14,4 +14,10 @@
<item name="colorAccent">@color/colorPrimary</item>
</style>
<style name="EditTextTheme" parent="Widget.Design.TextInputLayout">
<item name="colorControlNormal">@color/colorAccent</item>
<item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item>
</style>
</resources>
......