Projekt-Anfragen: Tel: 07022/9319004 info@CodeDocu.de Software Entwicklung in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Android java: Code Bereich //region - //endregion

 

Wie kann man in Android einen Code-Bereich erstellen?

 

Lösung:

Mit //region -Code- //endregion

 

Geschlossener //region Bereich

Region:Color_Picker

 

 

 

Geöffneter //region - //endregion Bereich

//region Region:Color_Picker
    //===================< region: Color_Picker >===================
   
public void load_Color_Picker() {
       
//------------< load_Color_Picker() >-----------
        //< init >
        //*Colors from file colors_picker.xml
       
String[] colors = getResources().getStringArray(R.array.color_picker);
       
//</ init >

        //----< @Loop: Colors-Array >----
       
Integer iMax=colors.length;
       
for( Integer iColor=0;iColor< colors.length;iColor++) {
           
//-< create Color_Button >-
           
String color = colors[iColor];
            Button btn =
new Button(this);
            btn.setBackgroundColor(Color.parseColor(color));
            btn.setOnClickListener(
onColor_clicked);
           
//-< create Color_Button >-

            //< add >
           
LinearLayout panel_color = findViewById(R.id.panel_ColorPicker);
            panel_color.addView(btn);
            LinearLayout.LayoutParams lp=
new LinearLayout.LayoutParams(60,LinearLayout.LayoutParams.WRAP_CONTENT);
            btn.setLayoutParams(lp);
           
//</ add >
       
}
       
//----</ @Loop: Colors-Array >----
        //------------</ load_Color_Picker() >-----------
   
}

    View.OnClickListener
onColor_clicked = new View.OnClickListener() {
       
public void onClick(View view) {
           
//-----------< onButton_clicked() >------------
            //< get_button >
           
Button btn=(Button) view;
            ColorDrawable viewColor = (ColorDrawable) btn.getBackground();
           
int colorId = viewColor.getColor();
            String sColor=String.valueOf(colorId);
           
//</ get_button >

            //--< set_Note_Color >--
           
EditText edit=_row_Input.findViewWithTag("edit_" + _sDateShort_Input);
           
if(edit!=null)
            {
                edit.setBackgroundColor(colorId);
            }
           
//--</ set_Note_Color >--

            //-----------</ onButton_clicked() >------------
        
}
    };
   
//===================</ region: Color_Picker >===================
//endregion

 

 

 

In C#

#region #endregion

Mobile

.

Jobs, Projekte, Angebote für Freiberufler, Selbstständig an Info@CodeDocu.de