CustomDialogs
An Android Library containing a set of custom dialogs
Install / Use
/learn @TheRandomCrafter83/CustomDialogsREADME
Custom Dialogs
<p align=center> <b><i>Custom dialogs at your fingertips</i></b> </p>Custom Dialogs is an Android Library containing several useful custom dialogs.
- Added a BaseDialog for all other Dialogs to inherit from for cleaner code.
- Library contains the following custom dialogs:
- ColorDialog: used to allow the user to choose a color. The selected color will be returned via the listener. (See Screenshots below)
Features
- Set the dialog's background color
- Title
- Text color
- Margins
- An icon for the dialog
Tech
Custom Dialogs is an open source project which can be found Here on GitHub.
Installation
IMPORTANT This library requires the repository mavenCentral().
build.gradle(App Module) - then you can add the following in your module level's dependencies section. Replace '[build]' with build version located above.
implementation 'io.github.therandomcrafter83:custom-dialogs:[build]' //<--add this implementation to the dependencies section
Example Usage
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.coderz.f1.customdialogs.colordialog.ColorDialog;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ColorDialog cd = new ColorDialog(MainActivity.this, new ColorDialog.DialogResponseListener() {
@Override
public void onOkClicked(int color) {
button.setText(Integer.toString(color));
}
@Override
public void onCancelClicked() {
}
});
cd.setTitle("Choose a color");
cd.setTabIndex(ColorDialog.TabIndex.PALETTE);
cd.setInitialColor(Color.RED);
cd.setMargins(8);
cd.setBackgroundColor(Color.GRAY);
cd.setTextColor(Color.YELLOW);
cd.showDialog();
}
});
}
}
Screenshots
ColorDialog
<table> <tr> <td>Hue Palette</td> <td>RGB Sliders</td> </tr> <tr> <td valign="top"><img src="readme_images/colordialog_screenshot1.png"></td> <td valign="top"><img src="readme_images/colordialog_screenshot2.png"></td> </tr> </table>License
Copyright 2021 Carl Williams [TheRandomCrafter83]
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
