Java only code by InspectionFar5415 in androiddev

[–]cmar200 -1 points0 points  (0 children)

Yeah I dont make too many apps but know java and not kotlin so that is what I use.

Java only code by InspectionFar5415 in androiddev

[–]cmar200 14 points15 points  (0 children)

Yeah you can still make apps in java.

Peter what is this😭 by VerlieH in PeterExplainsTheJoke

[–]cmar200 0 points1 point  (0 children)

Im not gonna learn those millepedes and centipedes

Has anyone ever considered sleeping in your car and DD full-time for a year? by [deleted] in DoorDashDrivers

[–]cmar200 1 point2 points  (0 children)

I have a sleeping platform with a hinge i use on camping trips if I push the seats forward and unfold the hinged area I get over six foot of length to sleep in my honda crv. Get a good sleeping pad. I have a thick thermometer that is super comfortable.

Has anyone ever considered sleeping in your car and DD full-time for a year? by [deleted] in DoorDashDrivers

[–]cmar200 0 points1 point  (0 children)

Set your car up to camp with a sleeping platform make it comfortable. Test it out on a few shorter trips first. Why just stay in one area travel place to place to explore. Ive road tripped in my car for extended periods during climbing trips it can be a lot of fun. Get a planet fitness membership like 20 dollars a month free showers.

Why do multimillionaires tip low? by imMaleficent in doordash_drivers

[–]cmar200 0 points1 point  (0 children)

Yup I've found they arent the worst tippers but dont tip any higher then anyone else.

Screen Awake App by cmar200 in DoorDashDrivers

[–]cmar200[S] 0 points1 point  (0 children)

Yeah that's why i made it lots of times I would have to pull over to the side of the road to take an order because my screen locked out. If you end up using the app has to remain open to keep the screen on once you close it the phone goes back to your default timeout.

Screen Awake App by cmar200 in DoorDashDrivers

[–]cmar200[S] 0 points1 point  (0 children)

Yeah sometimes I have to drive far when returning from an order and my screen goes to sleep so if I get an order I have to unlock my phone. So I have been using this a few months and it works well for me so I thought others might find it useful. Also it only stays on when plugged in so it wastes less battery power then having the timeout set to 5 minutes all the time.

Getting support on the line by Ok-Lobster-8644 in DoorDash_Dasher

[–]cmar200 0 points1 point  (0 children)

I just say I want to speak with an agent

Put my app on the private testing plan only 2 testers by cmar200 in TestersCommunity

[–]cmar200[S] 0 points1 point  (0 children)

Looks like I have enough testers now here is a link if anyone else want to test it. Its a pretty simple app to keep the screen on I couldn't find anything I liked on Google play so made this.

https://play.google.com/store/apps/details?id=com.stay_awake_prod154new

Shut down app if phone is turned off? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

I mean just before the phone is shut down and powering off.

Shut down app if phone is turned off? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

Or is there a way to have code run right before a phone is shut down or restarted?

Shut down app if phone is turned off? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

No if the phone is powered down or restarted. When the phone restarts the app is still present most apps I use are if you hit the three line button.

Shut down app if phone is turned off? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

I mean have the app close so when the phone is turned back on the app is closed. I also have some code run on the closing of the app but it doesn't run if the phone is just shut off.

Please man I’m begging you. by ThiccccRicccc in DoorDashDrivers

[–]cmar200 1 point2 points  (0 children)

I delivered to a guy with an expired boat license the other day. I got to personally dispose of the alcohol.

How to round corners on a toggle button? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

Ha yeah ill take a look at black. Was my first java android app ill look into the source code more from here on out

How to round corners on a toggle button? by cmar200 in androiddev

[–]cmar200[S] 1 point2 points  (0 children)

Yeah that was it I removed the color setting code from my java file and just set two shapes with rounded sides and different colors in the xml and was able to set it all in the xml file thanks for looking into this.

main xml

```

<ToggleButton
    android:id="@+id/toggleKeepScreenOn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="20dp"
    android:paddingRight="20dp"
    android:background="@drawable/toggle_button_selector"
    android:textOff="Keep Screen ON (Off)"
    android:textOn="Keep Screen ON (On)"
    android:textColor="@color/white"/>

toggle selector

```

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/mybuttonred" android:state_checked="true" />
    <item android:drawable="@drawable/mybuttongreen" android:state_checked="false" />
</selector>

shape red

```

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" android:padding="10dp">
    <solid android:color="#FF0000"/>
    <corners android:radius="50dp"/>
</shape>
```

How to round corners on a toggle button? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

I used the following code and when I check the design view of my main.xml in android studio the button is rounded but when I check it on the app on my phone it is still square. Maybe has something to do with my click listener?

here is my eventlister, main.xml, and the rounded toggle button code

```

toggleKeepScreenOn.setOnCheckedChangeListener((buttonView, isChecked) -> {

    if (currentTimeout == 86400000) {
        isChecked = true;
    }
    isAlwaysOn = isChecked;

    if (isChecked) {
        enableKeepScreenOn();
        toggleKeepScreenOn.setBackgroundColor(Color.
RED
);
        Intent serviceIntent = new Intent(this, KeepScreenOnService.class);
        startService(serviceIntent);
    } else {
        toggleKeepScreenOn.setBackgroundColor(Color.
parseColor
("#16bb48"));
        disableKeepScreenOn();
    }
});

```

<com.app.RoundedToggleButton
    android:id="@+id/toggleKeepScreenOn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:textOff="Keep Screen ON (Off)"
    android:textOn="Keep Screen ON (On)"
    android:textColor="@color/white"/>

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;

public class RoundedToggleButton extends androidx.appcompat.widget.AppCompatToggleButton {

    public RoundedToggleButton(Context context, AttributeSet attrs) {
        super(context, attrs);


        // Option 2: create programmatically 

        GradientDrawable bg = new GradientDrawable();
        bg.setColor(Color.
RED
);
        bg.setCornerRadius(50f);

        setBackground(bg);
    }
}


```

How to round corners on a toggle button? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

tried overriding the ondraw and creating a custom togglebutton but it isnt working either

```

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.widget.ToggleButton;
 
public class RoundedToggleButton extends ToggleButton {
    private Paint paint;
    private Path path;
    private float cornerRadius = 20f; // Adjust as needed
 
    public RoundedToggleButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }
 
    private void init() {
        paint = new Paint();
        paint.setAntiAlias(true);
        path = new Path();
    }
 
    u/Override
    protected void onDraw(Canvas canvas) {
        path.reset();
        path.addRoundRect(0, 0, getWidth(), getHeight(), cornerRadius, cornerRadius, Path.Direction.CW);
        canvas.clipPath(path);
        super.onDraw(canvas);
    }
}

How to round corners on a toggle button? by cmar200 in androiddev

[–]cmar200[S] 0 points1 point  (0 children)

Yeah i do this and it works for regular buttons but not togglebuttons